International APPs / pygettext

Martin v. Löwis loewis at informatik.hu-berlin.de
Wed Oct 16 05:22:12 EDT 2002


Ingo Linkweiler <i.linkweiler at web.de> writes:

> I have replaced some strings by _("string"), and started pygettext.
> The result was a "messages.pot" file like this:
> 
> #: PyNassi.py:121
> msgid "&New Editor"
> msgstr ""
> 
> Where can I add the translations?

You need to add the translations into the msgstr fields, using normal
C/Python escape characters where necessary. You also need to fill out
the PO header, in particular by providing a charset definition.

> And what´s the next step?
> 
> "msgfmt" needs a ".po"-file, not a ".pot" file.

Yes. You copy messages.pot into messages.de.po, messages.fr.po,
messages.pt_BR.po, and so on, and each translator fills out his
translation - the original .pot (PO *Template*) remains unmodified.

Then you invoke msgfmt for each translation.

> What can I do, when some smaller changes are made on the source file?
> Is it possible to "update" the translation files without creating a
> new one?

Yes, you'll need to use GNU msgmerge for this - msgmerge has not been
rewritten in Python, yet. It will merge the new template with the old
translation, copying unmodified messages, marking modified messages
"fuzzy" (i.e. for review by the translator), and leaving new messages
with an empty translation.

Regards,
Martin



More information about the Python-list mailing list