GNOME Bugzilla – Bug 342256
libgnome build fails due to broken fa.po
Last modified: 2006-05-31 16:18:01 UTC
Please describe the problem: The format for .po files is that "msgid" and "msgstr" must be followed by a character string on the same line. This rule is enforced by the Solaris msgfmt, but not by the GNU one. The file fa.po has msgstr lines that are not followed by a string on the same line. Steps to reproduce: 1. Try to build libgnome-2.14.1 on NetBSD or Solaris 2. Watch it fail 3. Actual results: file=`echo fa | sed 's,.*/,,'`.gmo \ && rm -f $file && /pkg_comp/obj/pkgsrc/devel/libgnome/default/.tools/bin/msgfmt -o $file fa.po <stdin>:832: parse error <stdin>:894: parse error found 2 fatal errors gmake[2]: *** [fa.gmo] Error 1 gmake[2]: Leaving directory `/pkg_comp/obj/pkgsrc/devel/libgnome/default/libgnome-2.14.1/po' Expected results: I would expect the library to finish building. Does this happen every time? Yes. Other information: A patch that fixes the issue for me is here: http://terrorpin.net/~ben/docs/comp/os/netbsd/pkgsrc/fa.po.diff
Confirming; moving to correct component.
We probably need a script that checks for this during cvs commit, or things like this will happen again and again. Most translators use GNU gettext, and "msgfmt -cv" doesn't report anything in such cases. Fixed in HEAD. 2006-05-19 Roozbeh Pournader <roozbeh@farsiweb.info> * fa.po: Add empty strings after lonely msgstrs (gnome bug #342256, Ben Collver)
Or just report it to Bruno.
The PO format specification, in the GNU gettext manual, does not say that the msgstr keyword and the string that follows it must be on the same line. Your /pkg_comp/obj/pkgsrc/devel/libgnome/default/.tools/bin/msgfmt program rejects a valid PO file. What version of msgfmt is it? What does "/pkg_comp/obj/pkgsrc/devel/libgnome/default/.tools/bin/msgfmt --version" yield? The GNU AM_PO_SUBDIRS macro (in po.m4) makes sure to not use the Solaris and FreeBSD 'msgfmt' programs. Are you using this macro?
To quote directly from section 2.2 of the gettext info file, titled "The Format of PO Files": msgid "" "Here is an example of how one might continue a very long string\n" "for the common case the string represents multi-line output.\n" In this example, the empty string is used on the first line, to allow better alignment of the `H' from the word `Here' over the `f' from the word `for'. In this example, the `msgid' keyword is followed by three strings, which are meant to be concatenated. Concatenating the empty string does not change the resulting overall string, but it is a way for us to comply with the necessity of `msgid' to be followed by a string on the same line, while keeping the multi-line presentation left-justified, as we find this to be a cleaner disposition. The empty string could have been omitted, but only if the string starting with `Here' was promoted on the first line, right after `msgid'.(1) And footnote (1) states: (1) This limitation is not imposed by GNU `gettext', but is for compatibility with the `msgfmt' implementation on Solaris. $ ./.tools/bin/msgfmt --version msgfmt (GNU gettext) 0.10.35 Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Ulrich Drepper. It turns out that the strict enforcement of the gettext PO file format is introduced by pkgsrc tool wrappers. I also have a NetBSD problem report open for this. http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=33506 Since I am only reporting the issue, I don't have a stake in how the issue is resolved. It may make sense to continue communications with the author of the pkgsrc tool wrappers, Johnny Lam <jlam@pkgsrc.org> Cheers, Ben
Thanks for the quick fix! Could you please also commit it to the gnome-2-14 branch?
> "This limitation is not imposed by GNU `gettext', but is for > compatibility with the `msgfmt' implementation on Solaris." Solaris 10 msgfmt actually gives only a warning when the "" on the line after msgid is omitted. Any tool that gives an error on it is therefore more picky than necessary. > $ ./.tools/bin/msgfmt --version > msgfmt (GNU gettext) 0.10.35 You better remove that version of msgfmt from your disk immediately. Version 0.10.35 of msgfmt does not support CJK encoded PO files; actually for Big5 or Shift_JIS encoded PO files it produces wrong .mo files. This is why this version is no longer available from ftp.gnu.org. You better use gettext 0.10.40 or newer!!!
(In reply to comment #6) > Could you please also commit it to the gnome-2-14 branch? Done.