http://qs321.pair.com?node_id=725413

Hi all

I'm a co-maintainer of Locale::Maketext::Lexicon and I'd like to make a change to the format of the .po file created by Locale::Maketext::Extract / xgettext.pl.

Currently it writes out each entry in the .po file as:

#: $filename_1:$line $filename_2:$line ... #. (vars passed to maketext sub) msgid "string to translate" msgstr ""

However, when I edit the file with POEdit, it rewrites the file as:

#. (vars passed to maketext sub) #: $filename_1:$line #: $filename_2:$line ... msgid "string to translate" msgstr ""

... which causes a large unneccessary diff.

Looking at the gettext manual, having the vars comment before the file location seems to be consistent, but having the file references on new lines is controlled by the option --no-wrap. However, Locale::Maketext::Extract already wraps the msgids, so the behaviour is currently inconsistent.

What I'd like to know is: can I just make this change, or would it affect you with whatever client you use for editing the .po files? Should I be providing output format options instead?

thanks

Clint

Update: Turns out I hadn't read the gettext manual well enough. The msgid's are only split onto separate lines if they contain embedded newlines, so L::M::Extract is correct in this regard. However, the default for gettext is to have the arguments comment before the file positions, and to put each file position onto a separate line.

In the interests of maintaining backward compatibility, I've added the option --wrap which will split the file positions onto separate lines. This has been released as v 0.75 of Locale::Maketext::Extract (CPAN currently syncing)