Subject: | Newline handling in msgstr broken? |
Dear Locale::PO Team,
with the bugfix made for 0.24 the handling of msgstr strings containing '\\n' changed. While .po files generated with 0.23 using
Locale::PO->save_file_fromhash( "$file", \%pot );
are ok, the .po files generated with 0.24 or later are now broken.
Given the sample code from Synopsis for generating the .po header:
$po = new Locale::PO(-msgid=>'', -msgstr=>
"Project-Id-Version: PACKAGE VERSION\\n" .
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\\n" .
... more stuff ...
"Content-Transfer-Encoding: ENCODING\\n");
When using 0.23, the generated .po begins with:
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI +ZONE\n"
...
which is ok for further processing with msgcat & friends.
When using 0.24 or later, the msgstr contains only one line, and as a result, furhter processing with gettext tools fails because format is broken.
msgid ""
msgstr "Project-Id-Version: PACKAGE VERSION\\nPOT-Creation-Date: YEAR-MO-DA HO:MI +ZONE\\n..."
I don't understand gettext enough to tell what is broken in detail, but either the synopsis is wrong since 0.24, or the bugfix introduced a new bug.
A workaround is to use '\n' instead of '\\n' in msgstr, but is this correct in gettext universe?
I am using strawberry perl:
perl 5, version 16, subversion 2 (v5.16.2) built for MSWin32-64-multi-thread
with best regards
Alexander Haderer