On Jun 3, 2010, at 8:53 AM, Malcolm Greene wrote:
> Any one using the GNU gettext utilities to internationalize their
> applications?
Dabo uses gettext.
> I'm looking for tips and/or tools on how to efficiently work with
> gettext PO files when making small edits to large msgid values.
> Example: We have lots of multi-sentence/multi-paragraph messages
> that are stored in our PO message catalog files. If we make a
> very minor change to a message, perhaps editing a single sentence
> or even correcting punctuation, we lose our original translation
> when we run the msgmerge utility.
Yeah, that's certainly a limitation. You have to update *all* the msgid
values to match your edited version.
> Rather than re-translate long messages (that have already gone
> through an editorial approval process) from scratch, our
> translators return to backup copies of their PO files and
> manually search for the text of the last msgid/msgstr translation
> pair which they then diff against the current msgid values to see
> what has changed, followed by a copy and paste of the last
> translation which they then edit to reflect the updated msgid
> value.
> That's a lot of work! Certainly there must be a better way of
> handling this type of workflow?
In Python you could write a simple function to locate the particular
msgid you are editing and replace it with the new version, and then apply it
with os.walk() to the directory containing all your translations.
If you're into Perl, there is a one-liner that can do it:
perl -pi -e 's/<orig>/<replacement>/g' *po
...where you replace <orig> and <replacement> with the old and new strings, but
this can get hairy with multi-line values containing quote characters.
> Is there a best practice way to archive and find previous
> translations that are no longer in a PO file? One idea that comes
> to mind is to store a unique msg id in the text of our messages
> or in the comments that precede our message and use this id to
> retrieve previous msgid/msgstr translation pairs for review. Or
> are there PO editors or online services that make this process
> more efficient?
Seems like a bit of overkill; 'msgid' is already a unique identifier.
Just track the pre-edit value, and use that to replace the other .po files with
the new post-edit value.
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.