Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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 /

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?



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

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2023-01-30 17:21 GMT
Find Nodes?
    Voting Booth?

    No recent polls found