I have followed the instructions of the gettext online manual
(http://www.gnu.org/manual/gettext/), but I am stuck with the
problem that 'msgfmt' does not seem to be called.
I named the package 'gnome-skeleton' for now. I have a
'po' subdirectory where 'xgettext' created a file called
'gnome-skeleton.pot'. I made a copy of this file under the name
'fr.po' to create the French translation. I hope this was the
right way to create an initial .po file.
I don't know what I am supposed to do to have 'msgfmt' be called on
'fr.po' to produce 'fr.gmo'. The file 'po/Makefile' does not seem
to contain any rule that would call 'msgfmt'.
The configure.in file contains the line
ALL_LINGUAS="fr"
Can anyone see what I might have omitted?
I have put a distribution of my current package (89310 bytes) here:
http://www3.sympatico.ca/sarrazip/gnome-skeleton-0.0.tar.gz
When I get through this, I intend to publish this skeleton as a
learning tool for interested developers.
--
Pierre Sarrazin <sarrazip at sympatico dot ca>
Yes. Make sure that the header is correctly filled out with the
language encoding etc.
> I don't know what I am supposed to do to have 'msgfmt' be called on
> 'fr.po' to produce 'fr.gmo'. The file 'po/Makefile' does not seem
> to contain any rule that would call 'msgfmt'.
>
> The configure.in file contains the line
>
> ALL_LINGUAS="fr"
That's correct.
> Can anyone see what I might have omitted?
$ grep MSGFMT po/Makefile.in.in
GMSGFMT = @GMSGFMT@
MSGFMT = @MSGFMT@
$(MSGFMT) -o $@ $<
&& rm -f $$file && $(GMSGFMT) --statistics -o $$file $<
$ grep msgfmt po/Makefile
GMSGFMT = /usr/local/pkg/gettext/bin/msgfmt
MSGFMT = /usr/local/pkg/gettext/bin/msgfmt
It looks like it's there to me...
Try running `make dist', this should make .gmo files for
distribution. Also `make -C po DESTDIR=/tmp/potest install' should
make and install the .gmo files as .mo files. You need to get gettext
0.10.39 as DESTDIR and MKINSTALLDIRS were broken in earlier releases
before 0.10.36, and numerous other bugs are now fixed.
--
Roger Leigh ** Registration Number: 151826, http://counter.li.org **
Need Epson Stylus Utilities? http://gimp-print.sourceforge.net/
For GPG Public Key: finger rl...@tower.york.ac.uk or see public keyservers.
>> The configure.in file contains the line
>>
>> ALL_LINGUAS="fr"
>
>That's correct.
[...]
>Try running `make dist', this should make .gmo files for
>distribution. Also `make -C po DESTDIR=/tmp/potest install' should
>make and install the .gmo files as .mo files. You need to get gettext
>0.10.39 as DESTDIR and MKINSTALLDIRS were broken in earlier releases
>before 0.10.36, and numerous other bugs are now fixed.
I did the upgrade (from 0.10.35 to .39) and those things worked,
but not before I discovered that I needed to add the following line
to configure.in:
CATALOGS="fr.gmo" # list of .gmo files in the po subdir to be installed
Without this line, 'make install' did not install any .mo files.
I had to discover this by studying po/Makefile.
I suspect that there is a cleaner way. It would seem like CATALOGS
should be computed automatically from ALL_LINGUAS. Interestingly,
I find no occurrence of ALL_LINGUAS in the project's generated
makefiles. There is no occurrence of CATALOGS in the gettext manual
(which still bears the version number 0.10.35).
Thank you very much for your help. I now have a working example.
Those who want to see it can download it from this URL:
http://www3.sympatico.ca/sarrazip/gnome-skeleton-0.1.tar.gz
I have never used this. In the gimp-print configure.in, I just use
ALL_LINGUAS -- it works fine. See the URL in my sig for how to get
the latest development release, which uses this (for an example). Did
you follow every instruction in gettext.info for how to gettextise
your package correctly?
> I suspect that there is a cleaner way. It would seem like CATALOGS
> should be computed automatically from ALL_LINGUAS. Interestingly,
> I find no occurrence of ALL_LINGUAS in the project's generated
> makefiles. There is no occurrence of CATALOGS in the gettext manual
> (which still bears the version number 0.10.35).
Just do
AC_SUBST(ALL_LINGUAS)
and it will automagically appear in every Makefile.in generated by
automake.
As for CATALOGS, is it AC_SUBST'ed and derived from ALL_LINGUAS in
gettext.m4 (AM_WITH_NLS):
,----[ gettext.m4 ]
| AC_SUBST(CATALOGS)
| [...]
| if test "x$CATOBJEXT" != "x"; then
| if test "x$ALL_LINGUAS" = "x"; then
| LINGUAS=
| else
| AC_MSG_CHECKING(for catalogs to be installed)
| NEW_LINGUAS=
| for presentlang in $ALL_LINGUAS; do
| useit=no
| for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
| # Use the presentlang catalog if desiredlang is
| # a. equal to presentlang, or
| # b. a variant of presentlang (because in this case,
| # presentlang can be used as a fallback for messages
| # which are not translated in the desiredlang catalog).
| case "$desiredlang" in
| "$presentlang"*) useit=yes;;
| esac
| done
| if test $useit = yes; then
| NEW_LINGUAS="$NEW_LINGUAS $presentlang"
| fi
| done
| LINGUAS=$NEW_LINGUAS
| AC_MSG_RESULT($LINGUAS)
| fi
|
| dnl Construct list of names of catalog files to be constructed.
| if test -n "$LINGUAS"; then
| for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
| fi
| fi
`----
Maybe you are using the gettext.m4 from you *old* version of gettext?
> Thank you very much for your help. I now have a working example.
You're welcome.