-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Sending again. Sent to local lang list by mistake.
Hello, can some msgmerge guru help with the following situation: I have a RHEL5 po file with untranslated strings which are translated in F8/F9 po files for the same package. How can I grab only the translated stuff (without the new strings) and merge them with the RHEL5 po file?
Any ideas are welcome before I sit down and start writing a script. I don't want to copy&paste strings but I'd like to re-use the work done by other translators.
Thanks, Alexander.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Alexander Todorov wrote:
Sending again. Sent to local lang list by mistake.
Hello, can some msgmerge guru help with the following situation: I have a RHEL5 po file with untranslated strings which are translated in F8/F9 po files for the same package. How can I grab only the translated stuff (without the new strings) and merge them with the RHEL5 po file?
Any ideas are welcome before I sit down and start writing a script. I don't want to copy&paste strings but I'd like to re-use the work done by other translators.
The following seems to work
#!/usr/bin/env python
###################################################################################### # replace all untranslated strings in old_file with their translations from new_file ######################################################################################
import sys sys.path.append('/home/alexx/temp/polib-0.3.1')
# http://code.google.com/p/polib/ import polib
old_file='/home/alexx/temp/anaconda/anaconda.rhel5-branch.bg.po' new_file='/home/alexx/temp/anaconda/anaconda.f8-branch.bg.po' save_file='/home/alexx/temp/anaconda/translated.po'
old_po = polib.pofile(old_file) tr_po = polib.pofile(old_file) new_po = polib.pofile(new_file)
new_entries={}
for e in new_po: new_entries[e.msgid] = e
for u in old_po.untranslated_entries(): if new_entries.has_key(u.msgid): tr_po[old_po.index(u)] = new_entries[u.msgid]
tr_po.save(save_file)
print "OLD: %d percent translated" % old_po.percent_translated() print "UPD: %d percent translated" % tr_po.percent_translated()
Thanks, Alexander.
_______________________________________________ Fedora-trans-bg mailing list Fedora-trans-bg@redhat.com https://www.redhat.com/mailman/listinfo/fedora-trans-bg
On Wed, Mar 5, 2008 at 6:35 PM, Alexander Todorov atodorov@redhat.com wrote:
Hello, can some msgmerge guru help with the following situation: I have a RHEL5 po file with untranslated strings which are translated in F8/F9 po files for the same package. How can I grab only the translated stuff (without the new strings) and merge them with the RHEL5 po file?
I might be missing something, but wouldn't `msgmerge f8.po rhel5.po` work? By using rhel5 as the template, only new translations for existing msgids will be brought from f8, no?
-d
Any ideas are welcome before I sit down and start writing a script. I don't want to copy&paste strings but I'd like to re-use the work done by other translators.
Thanks, Alexander.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Dimitris Glezos wrote:
On Wed, Mar 5, 2008 at 6:35 PM, Alexander Todorov atodorov@redhat.com wrote:
Hello, can some msgmerge guru help with the following situation: I have a RHEL5 po file with untranslated strings which are translated in F8/F9 po files for the same package. How can I grab only the translated stuff (without the new strings) and merge them with the RHEL5 po file?
I might be missing something, but wouldn't `msgmerge f8.po rhel5.po` work? By using rhel5 as the template, only new translations for existing msgids will be brought from f8, no?
That's what I thought but I'm not sure what is brought in the rhel5.po. The difficulty to verify comes also from similar strings and fuzzy entries so it's not quite clear to me if everything is ok. Anyway using the script snippet I sent earlier works well enough and the diff contains only the translated items which is easier to verify.
Thanks, Alexander.