Step by Step: The Translation of POTs and POs
Prev
Next

Step by Step: The Translation of POTs and POs

General material on the subject can be found in the Info pages for the Gettext package. For a basic understanding of what is expected in KDE translation it follows a description of how the handling of POTs and POs looked like before it was done with specialized programs like KBabel:

Nowadays, most of these steps are done automatically by specialized programs like KBabel — from choosing the POT files and saving them as POs, through header updates and removing fuzzy entries to syntax checks.

A sample header could look like this:

msgid ""
msgstr ""
"Project-Id-Version: Some Program\n"
"POT-Creation-Date: 2005-08-23 02:43+0200\n"
"PO-Revision-Date: 2005-08-28 12:25+0200\n"
"Last-Translator: Somebody <null@kde.org>\n"
"Language-Team: Some Language <kde-i18n-doc@kde.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11\n"
"Plural-Forms:  nplurals=2; plural=(n != 1);\n"

If you are working with a text editor do not remove the initial "msgid / msgstr". Otherwise, the compilation will terminate with a parse error. On the other hand, you should remove the "fuzzy" which is initially there.

The entries for Content-Type and the Transfer-Encoding are not relevant at the moment. But the charset should be set to UTF-8 in this case, i.e. 8bit Unicode Transfer Format.

The actual translation would look as follows. The original line:


#: kedit.cpp:90 kedit.cpp:1071
msgid "Show &Status Bar"
msgstr ""

...you would translate like this (assuming you were translating it to German):


#: kedit.cpp:90 kedit.cpp:1071
msgid "Show &Status Bar"
msgstr "&Statusleiste anzeigen"

And from the incorrect:


#: ReniceDlg.cpp:31
#, fuzzy
msgid "Renice Process"
msgstr "Laufende Prozesse"

...you would produce the correct translation:


#: ReniceDlg.cpp:31 
msgid "Renice Process"
msgstr "Neue Prozessprioritaet"

After the corrections have been done you need to delete the "fuzzy" tag. Otherwise, the corrected string will just be ignored during compilation.

Finally there might be lines at the end of the file beginning with "#~" like this:


#~ msgid "Where do you want to go tomorrow?"
#~ msgstr "Where do you want to go tomorrow?"
#~ msgid "No comment available"
#~ msgstr "Keine Erklärung verfügbar"

These lines have been commented out, usually because they are no longer used by the program and should be deleted from time to time in the interest of disk space and bandwidth. Once more, KBabel, for instance, does this automatically.

For any other questions on this topic you are once more advised to look at the Info pages for the GNU gettext package (see the KDE on-line help).

Prev
Next
Home