i18n (an abbreviation of internationalization) is the process of translating the user interface and documentation of a piece of software into another language. i18n.kde.org is the central information point for the effort to translate KDE software into other languages.
Translation of the user interface an application is done using
.pot files and
.pot file, is generated from the source
code of the program itself, and contains all of the strings / fragments of text,
that are used in the program.
Before a string in a program is include in the
file, it needs to be marked with the
#!/usr/bin/env python from kdecode import * ... mylabel = QLabel(i18n("Select new directory:")) ...The
i18n()is part of the kdecode package and needs to be imported.
PyKDE Extensions provides support for generating
files and managing and updating
By using the i18n argument to setup()
setup.py, you can specify the directory
that should contain the
.po files. The argument for
i18n is a tuple. The first item is the relative path
to the directory where the translation files should be stored. The
second item is a list of directories that should be scanned for Python source
files containing translatable strings.
i18n = ('po',['.','mymodule'])
setup.py is configured, use this command in the
shell to generate the
python setup.py update_messagesThis command also updates any already existing
.pofiles with any new messages.
PyKDE Extensions also handles installing translation files and converting
.po files into the special binary format
needed by the application at runtime.