Your message dated Sat, 19 Jul 2014 15:52:09 +0200 (CEST)
with message-id <[email protected]>
and subject line gettext: syntax error if comments are reordered
has caused the Debian Bug report #516889,
regarding gettext: syntax error if comments are reordered
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
516889: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=516889
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: gettext
Version: 0.17-4
Hi,
I noticed that msgmerge is very picky about the order of comments in PO
files.
$ cat test.po
msgid ""
msgstr ""
"Project-Id-Version: test\n"
"PO-Revision-Date: 2009-02-23 23:21+0100\n"
"Last-Translator: <jens@localhost>\n"
"Language-Team: German <jens@localhost>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#| msgid "File not found :-)"
#: test.cc:1
#, c-format
msgid "File not found"
msgstr "Datei nicht gefunden"
$ msgfmt -cv test.po
test.po:13:1: syntax error
msgfmt: found 1 fatal error
Reordering the comments to
#: test.cc:1
#, c-format
#| msgid "File not found :-)"
fixes this problem.
You may ask why I used a PO file with such an ordering, right? The reason
is that I have also access to gettext version 0.15 (doesn't support
--previous option of msgmerge) and with this version I get:
$ sed 's/test.cc:1/test.cc:2/' test.po > test-new.po
$ msgmerge -U test-new.po test.po
Comments look now:
# | msgid "File not found :-)"
#: test.cc:1
#, c-format
I now substituted "# |" by "#|" because I don't want to commit a PO file
with unwanted "# |" comments and get an invalid file ...
Nevertheless gettext 0.15 doesn't report errors so I committed a bogus
file.
PS: Just in case you wonder why I call msgmerge to update a file against
itself: I found that this improves line breaks (the result of msgmerge
and xgettext is very different in this regard!!) and leads to smaller diffs
for version control systems. This is probably worth a separate bug report.
Jens
--- End Message ---
--- Begin Message ---
On Tue, 24 Feb 2009, Jens Seidel wrote:
> Package: gettext
> Version: 0.17-4
>
> Hi,
>
> I noticed that msgmerge is very picky about the order of comments in PO
> files.
>
> $ cat test.po
> msgid ""
> msgstr ""
> "Project-Id-Version: test\n"
> "PO-Revision-Date: 2009-02-23 23:21+0100\n"
> "Last-Translator: <jens@localhost>\n"
> "Language-Team: German <jens@localhost>\n"
> "MIME-Version: 1.0\n"
> "Content-Type: text/plain; charset=UTF-8\n"
> "Content-Transfer-Encoding: 8bit\n"
>
> #| msgid "File not found :-)"
> #: test.cc:1
> #, c-format
> msgid "File not found"
> msgstr "Datei nicht gefunden"
>
>
> $ msgfmt -cv test.po
> test.po:13:1: syntax error
> msgfmt: found 1 fatal error
I forwarded this bug upstream but got no reply.
However, what you describe is what I would expect by reading the
manual:
One PO file "entry" has the following schematic structure:
WHITE-SPACE
# TRANSLATOR-COMMENTS
#. EXTRACTED-COMMENTS
#: REFERENCE...
#, FLAG...
#| msgid PREVIOUS-UNTRANSLATED-STRING
msgid UNTRANSLATED-STRING
msgstr TRANSLATED-STRING
So this is not a bug, as the .po file was not sintactically correct.
Later in your report you said that you are using both an old version
of gettext not supporting --previous and a recent version which does.
Well, --previous is now old enough that I don't think we should really
worry about such kind of mixed environments.
Thanks.
--- End Message ---