After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 342256 - libgnome build fails due to broken fa.po
libgnome build fails due to broken fa.po
Status: RESOLVED FIXED
Product: l10n
Classification: Infrastructure
Component: Persian [fa]
GNOME 2.14
Other All
: Normal critical
: ---
Assigned To: Roozbeh Pournader
Roozbeh Pournader
Depends on:
Blocks:
 
 
Reported: 2006-05-18 14:32 UTC by Ben Collver
Modified: 2006-05-31 16:18 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14



Description Ben Collver 2006-05-18 14:32:10 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
Comment 1 Christian Persch 2006-05-19 12:53:22 UTC
Confirming; moving to correct component.
Comment 2 Roozbeh Pournader 2006-05-19 14:55:00 UTC
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)
Comment 3 Behdad Esfahbod 2006-05-19 17:00:37 UTC
Or just report it to Bruno.
Comment 4 Bruno Haible 2006-05-19 19:31:52 UTC
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?
Comment 5 Ben Collver 2006-05-19 22:09:09 UTC
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
Comment 6 Christian Persch 2006-05-20 10:46:01 UTC
Thanks for the quick fix! 

Could you please also commit it to the gnome-2-14 branch?
Comment 7 Bruno Haible 2006-05-20 16:04:26 UTC
> "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!!!
Comment 8 Roozbeh Pournader 2006-05-31 16:18:01 UTC
(In reply to comment #6)
> Could you please also commit it to the gnome-2-14 branch?

Done.