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)


In reply to RFC for users of Locale::Maketext::Lexicon by clinton

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.