Enforce newline character count at beginning and end to match msgid

Bug #117 reported by Tim Müller
Affects Status Importance Assigned to Milestone
Launchpad itself
Carlos Perelló Marín

Bug Description

Rosetta should make sure that a translated message has the same number of newline characters (if any) at the beginning and the end as the original message had.

In two out of three cases where I imported .po files into my project, the newline count didn't match, which resulted in fatal build errors courtesy of a somewhat picky msgfmt, e.g.:

   xx.po:513: `msgid' and `msgstr' entries do not both begin with '\n'
   /usr/bin/msgfmt: found 1 fatal error


   zz.po:339: `msgid' and `msgstr' entries do not both end with '\n'
   /usr/bin/msgfmt: found 1 fatal error

This means that the developer importing the .po file needs to hand-edit it, which is unnecessary, as Rosetta should be able to handle that easily automatically.


Revision history for this message
Tim Müller (t-i-m-zen) wrote :

It appears those messages above are in fact due to a real bug in rosetta:

Exported .po files (from today) sometimes contain the unicode character U+21B5 (Downwards Arrow with Corner Leftwards) as UTF-8 sequence 0xE2 0x86 0xB5 instead of the real newline character (sometimes in addition to?).

I suspect this is because you use this symbol in the web interface to denominate a newline character?


Changed in rosetta:
assignee: nobody → carlos
status: New → Accepted
Changed in rosetta:
status: Accepted → Fixed
Revision history for this message
Carlos Perelló Marín (carlos) wrote :

We finished the validation code so new strings will be rejected if gettext's msgfmt checks fail for that string.

Will be available to Rosetta users on Monday.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers