On Jun 7, 2010, at 1:04 PM, Malcolm Greene wrote:

> I guess I'm a bit thick headed today, but I'm struggling with your
> suggestion. I don't see how your suggestion allows me to
> programmatically associate an original msgid with the updated value of a
> msgid if I don't have a unique key embedded in my msgid's that stays the
> same across edits.

        OK, let's assume that you have an existing translation in several 
languages, and you want to modify the English (original) language version. The 
msgid value in the .po file is the unique identifier that links the translated 
texts, right?

        To give an example, let's assume the original English was "This is the 
original". In your translation file for a given language, there will be an 
entry that looks like:

msgid "This is the original"
msgstr "kdsj jsh fsd hfgidsgiusdo hgsdh ghsd"

        Now you want to edit the original without losing the translations, 
right? What I'm suggesting is (in Fox terms) parsing the .po files into a 
cursors, with 'msgid' and 'msgstr' columns. Locate the record you want to 
change, and do

origid = "This is the original"
newid = "This is NOT the original"
select lang_en
replace msgid with newid for msgid = origid

select lang_es
replace msgid with newid for msgid = origid
writeCursorToPoFile()
compilePoToMo()
select lang_de
replace msgid with newid for msgid = origid
writeCursorToPoFile()
compilePoToMo()
... etc.

        Now all your .po files are keyed to the new English text. Your 
translations will not be updated, but the original translation is still linked 
to the new English text.


-- 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.

Reply via email to