[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Generating gettext's .pot file

From: Ben Reser <ben_at_reser.org>
Date: 2004-04-03 20:42:02 CEST

There are problems with this script:

On Sat, Apr 03, 2004 at 02:50:13PM -0300, Nicol?s_Lichtmaier wrote:
>#! /bin/bash

Please try to avoid using /bin/bash unless you really need it. Let's
stick with /bin/sh as it is more portable.

> cd ..

You're assuming that the user of the script is in a particular
directory. This is not a valid assumption. It'd be much better make
the script take a path to the top level of the source tree. Then when
we add it as a make target we can pass it "$abs_srcdir/subversion"

> xgettext -o po/subversion.pot -k_ -kN_ --msgid-bugs-address=dev@subversion.tigris.org $(find . -name "*.c")

Ugh. Don't do use find like this. This will fail if the number of
paths found exceed the argument limits of the shell.

(We'll ignore the files with space issue because fixing that requires
GNU findutils and we don't have spaces in our filenames, so it's just
easier to ignore it).

Further, not all the *.c files in the source tree should be searched by
this. The bindings for example have automatically generated .c files.
I'm not sure if we have any _() or N_() calls. But we really shouldn't
have gettext messing around in there.

Also my xgettext doesn't understand the
--msgid-bugs-address=dev@subversion.tigris.org option. So I've ommitted

So we should use this:


if [ -z "$1" ]; then
  echo 'Must pass the path to the source dir as an argument'
  exit 1
find . -path './tests' -prune -o -path './bindings' -prune -o \
  -name '*.c' -print | xgettext -o po/subversion.pot -k_ -kN_ -f -
cd po
msgmerge es.po subversion.pot -o es.pox

Ben Reser <ben@reser.org>
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Apr 3 20:42:19 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.