Thread: backend/po, make update-po works strange

backend/po, make update-po works strange

From
Kovacs Zoltan
Date:
Peter, 

running "make update-po" in backend/po/ I'm always getting very short .po
files and the .pot file is also about 7K. It seems to be the fact that
xgettext gets text only from postgres.c and postmaster.c. What's the
problem? Version: beta3 and beta5 (I didn't try beta4 but it's certainly
the same).

Regards, Zoltan

--                         Kov\'acs, Zolt\'an                        kovacsz@pc10.radnoti-szeged.sulinet.hu
          http://www.math.u-szeged.hu/~kovzol                        ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz
 



Re: backend/po, make update-po works strange

From
Peter Eisentraut
Date:
Kovacs Zoltan writes:

> running "make update-po" in backend/po/ I'm always getting very short .po
> files and the .pot file is also about 7K. It seems to be the fact that
> xgettext gets text only from postgres.c and postmaster.c. What's the
> problem? Version: beta3 and beta5 (I didn't try beta4 but it's certainly
> the same).

Since the postgres.pot file has nearly 400 dependency files (all backend
source files), it is currently handled in an odd way.  Observe this:

peter ~/pgsql/src/backend/po$ make init-po
find ./.. -name '*.c' -print >gettext-files
xgettext --foreign-user -ctranslator -D . -n -kelog:2 -kpostmaster_error -f gettext-files
mv messages.po postgres.pot

If the "find" somehow messes up you will get an incomplete .pot file.
Also note that there are no prerequisites declared for the file
"gettext-files".  That is, if it's wrong or outdated you need to remove it
first.

Suggestions for improvement welcome.

-- 
Peter Eisentraut   peter_e@gmx.net



Re: backend/po, make update-po works strange

From
Kovacs Zoltan
Date:
On Wed, 16 Jan 2002, Peter Eisentraut wrote:

> Kovacs Zoltan writes:
> 
> > running "make update-po" in backend/po/ I'm always getting very short .po
> > files and the .pot file is also about 7K. It seems to be the fact that
> > xgettext gets text only from postgres.c and postmaster.c. What's the
> > problem? Version: beta3 and beta5 (I didn't try beta4 but it's certainly
> > the same).
> 
> Since the postgres.pot file has nearly 400 dependency files (all backend
> source files), it is currently handled in an odd way.  Observe this:
> 
> peter ~/pgsql/src/backend/po$ make init-po
> find ./.. -name '*.c' -print >gettext-files
> xgettext --foreign-user -ctranslator -D . -n -kelog:2 -kpostmaster_error -f gettext-files
> mv messages.po postgres.pot
> 
> If the "find" somehow messes up you will get an incomplete .pot file.
> Also note that there are no prerequisites declared for the file
> "gettext-files".  That is, if it's wrong or outdated you need to remove it
> first.
> 
> Suggestions for improvement welcome.

I'm afraid the problem is that there are too few `gettext(...)'s in the
whole code in backend/. The file "gettext-files" is quite big: 10106 bytes
after each run of "make". I got the same result with "make init-po" and
"make update-po" (after "make maintainer-clean", of course). Perhaps the
original (>250K) .pot file was created with a different method...?

An example: parser/parse_agg.c contains an elog error at line 111 without
any gettext call. In opposite, postmaster/postmaster.c at line 290
contains an fprintf with a gettext call. Why the difference? Of course,
the second string will appear in postgres.pot and the first one
won't. File "gettext-files" contains both file.

Unfortunately this is only the first day I started to read the docs about
gettext, sorry...

TIA, Zoltan

--                         Kov\'acs, Zolt\'an                        kovacsz@pc10.radnoti-szeged.sulinet.hu
          http://www.math.u-szeged.hu/~kovzol                        ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz
 



Re: backend/po, make update-po works strange

From
Tom Lane
Date:
Kovacs Zoltan <kovacsz@pc10.radnoti-szeged.sulinet.hu> writes:
> An example: parser/parse_agg.c contains an elog error at line 111 without
> any gettext call. In opposite, postmaster/postmaster.c at line 290
> contains an fprintf with a gettext call. Why the difference? Of course,
> the second string will appear in postgres.pot and the first one
> won't. File "gettext-files" contains both file.

The elog() strings are supposed to be picked up without any additional
marking.  Sounds like you are using the wrong procedure for extracting
the strings.  But I dunno what the right procedure is ...
        regards, tom lane


Re: backend/po, make update-po works strange

From
Peter Eisentraut
Date:
Kovacs Zoltan writes:

> An example: parser/parse_agg.c contains an elog error at line 111 without
> any gettext call. In opposite, postmaster/postmaster.c at line 290
> contains an fprintf with a gettext call. Why the difference? Of course,
> the second string will appear in postgres.pot and the first one
> won't. File "gettext-files" contains both file.

Ah, you need to have GNU gettext 0.10.36 or later.

-- 
Peter Eisentraut   peter_e@gmx.net



Re: backend/po, make update-po works strange

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> Also note that there are no prerequisites declared for the file
> "gettext-files".  That is, if it's wrong or outdated you need to remove it
> first.

> Suggestions for improvement welcome.

Seems like it would be somewhat better if a plain "make clean" removes
gettext-files, not only maintainer-clean.  It's not like anyone hasn't
got "find", or even that "find" takes unreasonably long ...
        regards, tom lane