You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Nicolás Lichtmaier <ni...@reloco.com.ar> on 2004/04/03 17:50:13 UTC

Generating gettext's .pot file

As we don't have the standard gettext infrastructure I've made a lot 
script so that I could have the .pot file. Here it is. I run it from the 
"po" directory.


Re: Generating gettext's .pot file

Posted by Greg Stein <gs...@lyra.org>.
On Sun, Apr 04, 2004 at 01:24:09AM +0200, Sander Striker wrote:
> > From: Nicolas Lichtmaier [mailto:nick@reloco.com.ar]
> > Sent: Saturday, April 03, 2004 8:54 PM
> 
> > Ben Reser wrote:
>...
> > >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.
> >
> > Normal gettextized projects have a po/POTFILES.in file which list every 
> > file which has to be scanned.
> 
> I prefer to be lazy and have the build system take care of this for
> us.  I totally love the way gen-make takes care of generating our
> makefiles, vc workspaces, etc.  Hand maintaing is too error-prone IMO,
> and unnessecary.

Yup. We could have gen-make produce a list of the .c files that go into
Subversion (excluding generated .c files). It might not be too hard, even.
I know that it is a simple query from the dependency graph, but I think
that would pull in the bindings' .c files. So it might need a bit more
thought... mebbe there is a way to ask for all .c files which *aren't*
generated. Might require a bit of judo, but I bet the graph can answer
that question.

(then we dump that into POTFILES.in)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: Generating gettext's .pot file

Posted by Sander Striker <st...@apache.org>.
> From: Nicolas Lichtmaier [mailto:nick@reloco.com.ar]
> Sent: Saturday, April 03, 2004 8:54 PM

> Ben Reser wrote:
> 
>> There are problems with this script:
> 
> Uhm... I've never intended for it to be commited. I've provided it just 
> to show what needs to be added to the build scripts. If I had intented 
> it for being included in subversion I would have done it better =).

When you post something like a script, instead of a description,
the logical assumption is that you provided a working implementation.
Which you offer for review to be dropped into the source tree.

But hey, maybe I just make assumptions to easily.

> >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.
>
> Normal gettextized projects have a po/POTFILES.in file which list every 
> file which has to be scanned.

I prefer to be lazy and have the build system take care of this for
us.  I totally love the way gen-make takes care of generating our
makefiles, vc workspaces, etc.  Hand maintaing is too error-prone IMO,
and unnessecary.


Sander

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Generating gettext's .pot file

Posted by Nicolás Lichtmaier <ni...@reloco.com.ar>.
Ben Reser wrote:

>There are problems with this script:
>  
>

Uhm... I've never intended for it to be commited. I've provided it just 
to show what needs to be added to the build scripts. If I had intented 
it for being included in subversion I would have done it better =).

>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.
>  
>

Normal gettextized projects have a po/POTFILES.in file which list every 
file which has to be scanned.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Generating gettext's .pot file

Posted by Ben Reser <be...@reser.org>.
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
it.

So we should use this:

#!/bin/sh

SOURCEPATH=$1
if [ -z "$1" ]; then
  echo 'Must pass the path to the source dir as an argument'
  exit 1
fi
cd $SOURCEPATH
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 <be...@reser.org>
http://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