Potential problem with GlotPress-generated MO files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php-gettext |
New
|
Medium
|
Unassigned |
Bug Description
Nemanja Avramović reports that MO files generated by GlotPress sometimes cause weird trailing characters in translated strings.
In particular, he noticed it with the attached MO file when looking up a message like "Our Facebook" (see http://
However, msgunfmt reads it correctly and generates a proper PO file that can then be converted to MO file (with eg. msgfmt) that's identical to the one generated from the source PO file directly.
Since GlotPress-generated MO file is shorter than the one generated with msgfmt, I am suspecting that the optimized hash table is missing and that php-gettext is not handling that case well.
As Danilo explained, some strings have some weird character at the end which I can not even copy/paste here. Attached is a ZIP with three files:
* spanish.po (exported from GlotPress)
* not-working.mo (exported from GlotPress, has these weird characters)
* working.mo (spanish.po opened and saved with poEdit, doesn't have them)
If you open spanish.po file and do a search for word "Buscar", fourth result is one of the affected:
msgid "Search title or reference ID"
msgstr "Buscar título o ID de referencia"
At first I thought only strings with non-English- alphabet characters make problems (note the "í" in "título") but there seems not to be any rule, some strings with only English alphabet letters have this problem too, while some work fine even though they have non-English characters.