Next Previous Table of Contents
i18n is an internationalization standard that is used to offer internationalized versions of an application or project. The difficulty with writing applications is that they only support the language they originally are composed with; visually this can be seen on labels, menuentries and the like. Goal of the internationalization is to provide applications and library functions in the language of the user; therefore enabling users that are not capable of the original language to make use of the provided functionality.
KDE, as one of the most modern desktop environments, has set one of it's numerous goals to provide applications for users in their native language, and simplifies the work for developers to provide their application in any of the supported language.
Technically, this is realized by the KDE File System Standard which contains localization support for languages in terms of
documentation and by providing application internationalization through the use of the KDE-core library class KLocale. This class
does all the translation, dependend on the prefered language set in the KDE Control Center.
The developer on the other hand only has to know two things to make his application able to use this feature:
kapp.h into your sourcecode wherever a visible text appears in your application, e.g. in source files that contain
QLabels.i18n() macro provided by kapp.h.That is almost all you have to watch for while coding. Mind that you should not internationalize any configuration strings that are
used by KConfig, because this is not necessary on one hand and doesn't work for reading in values on the other; besides messes too
much in the translation files.
The KDE Team also provides numerous contacts to developers that are contributing to the KDE project as translators. Those are organized in language teams and coordinate the translation work.
For a full list and information who to ask for translating your application, see http://www.kde.org.
Before your application can support internationalization, you have to run "Make Messages and merge" from the "Project" menu. This will
scan all of your sourcefiles for the i18n() macro and extracts the strings into a <yourapp>.pot file, which is then placed
into the po subdirectory of your project.
Then select the desired language by choosing "Add new translation file" from the "Project" menu. After pressing "OK", the translation file will be build and added to the project in form of <language_prefix>.po, placed in the po directory.
When translation files have to be updated, run "Make Messages and merge" form the "Project" menu to extract the i18n() macros again into the pot file. In this context, merging means that the new strings that are added will be added to all currently integrated po files. Translators then only have to look for the strings currently not translated.
To translate the po files, the KDE SDK offers a tool that is called KTranslator. In case it is installed, selecting a po file will
open the file with KTranslator in the Tools-window where the message strings can be translated using the existing translation files
installed at the translator's KDE locale directory. If KTranslator is not installed, the po file is opened in the Resource window where
it can be edited manually as a text file.
Next Previous Table of Contents