Next Previous Table of Contents
i18n is an internationalization system 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, menu entries 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 and feel more comfortable.
KDE, as one of the most modern desktop environments, has set one of its numerous goals to provide applications for users in their native languages, 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, dependent on the preferred 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
to enable translation.klocale
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.
KDevelop also takes part on making life easier for developers to include native language support to their applications. Whenever you
create a new KDE project, a po
directory is added to the main project directory. There, your <application>.pot file
will be placed after the generation is complete. The .pot file already contains all strings that are set up with the i18n() macro,
therefore you only have to write your code using the macro again. From time to time, you should do a "Project"-"Make messages and
merge", which will automatically extract all macros again and rebuilds the potfile.
To add a language to your application, choose "Project"-"Add translation file", which opens the language selection dialog. Select the
desired language and press OK. Then, the according <lang>.po file will be build in the po
directory. Then start
translating the po file by selecting it from the po directory in the Real File Viewer or from the LFV, folder "Translations". If you
have KTranslator installed, it will be opened in the "Tools" window with KTranslator, otherwise as a text file in the header/resource
window.
KTranslator makes it very easy to translate strings by scanning the existing translations of your local KDE installation, so they can
be used already.
For editing by hand, we'll have a look at an example:
#: kscribble.cpp:619
msgid "Opens an existing document"
msgstr ""
The above shows a string that was extracted from the file kscribble.cpp
at line 619. msgid
and msgstr
are the tags which
give the information for the translation; msgstr
will contain the translated string. There, you have to watch escape sequences
such as \n or \t, which have to be included into the translation string. A German translation would therefore look like this:
#: kscribble.cpp:619
msgid "Opens an existing document"
msgstr "Öffnet ein existierendes Dokument"
That would be all to watch for translation; after you're done, save the file. When make is run within the po directory, the message files will be processed and errors may occur if strings are not translated consistently, e.g. escape sequences are missing. Then edit the according message string again and make sure that make runs without errors.
Additionally, you should be very careful when translating ampersands within text strings. The letters after ampersands are used as keyboard accelerator s in conjunction with the ALT key to access menubar or popup menu items to change the keyboard focus to the selected item more quickly. Now, if the same accelerator letter appears in the same keyboard focus area (which would be the main widget on one time, and a dialog at another), each widget after the first one cannot be accessed by the supposed keyboard accelerator . So even translators have a responsibility for the usage of the application under their language. There is also no guarantee that the original letter will occur in the translation, so translators have to choose very carefully and should test the application under their language after they installed the translation to ensure it runs without these malfunctions.
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 an actual list and information who to ask for translating your application, see http://www.kde.org.
The information below is taken from the KDE web site and contains the current contact addresses as of March 06, 1999. If you want to join a team please write directly to one of the team coordinators.
The translation of the KDE is organized by Juraj Bednar mailto:bednar@rak.isternet.sk and Matthias Elter me@kde.org
You can subscribe KDE internationalization mailing list kde-i18n-doc@kde.org by sending a mail to kde-i18n-doc-request@kde.org with the word "subscribe" in the subject line.
Before starting any translation work, please contact the according translation team leaders for coordination to avoid double work.
team coordinators: Jañ-Mai DRAPIER jdrapier@club-internet.fr website: http://perso.club-internet.fr/jdrapier
team coordinators: Sebastià Pla sastia@redestb.es
team coordinators: Miroslav Flídr flidr@kky.zcu.cz
team coordinators: Erik Kjær Pedersen erik@binghamton.edu
team coordinators: Thomas Diehl th.diehl@gmx.net website: http://www.dtp-service.com/kde/de/ mailing list: send a mail with 'subscribe' in the subject line to: kde-i18n-de-request@kde.org Webforum for discussions and user feedback: http://www.dtp-service.com/discus_d
team coordinators: Theodore J. Soldatos theodore@eexi.gr
team coordinators: Wolfram Diestel diestel@rzaix340.rz-uni-leipzig.de
team coordinators: Boris Wesslowski, Alonso Lara Boris@Wesslowski.com website: http://members.xoom.com/keko5/ mailing list: send a mail with 'subscribe' in the subject line to kde-es@kde.org
team coordinators: Hasso C. Tepper hasso@ewsound.estnet.ee
team coordinators: Kim Enkovaara kim.enkovaara@iki.fi
team coordinators: Francois-Xavier Duranceau Francois-Xavier.Duranceau@loria.fr website: http://www.loria.fr/~durancea/kde/wip-apps.html mailing list: send an empty mail to: kde-traduc-fr-subscribe@egroups.com
team coordinators: Erez Nir erez-n@actcom.co.il
team coordinators: Vladimir Vuksan vuksan@veus.hr
team coordinators: Marcell Lengyel miketkf@yahoo.com website: http://sophia.jpte.hu/~kde
team coordinators: Logi Ragnarsson, logir@imf.au.dk Thorarinn R. Einarsson, thori@mindspring.com Bjarni R. Einarsson, bre@netverjar.is Hrafnkell Eiriksson, hkelle@rhi.hi.is Gudmundur Erlingsson, gudmuner@lexis.hi.is Richard Allen ra@hp.is
team coordinators: Andrea Rizzi rizzi@kde.org
team coordinators: LinuxKorea Co. kde@linuxkorea.co.kr
team coordinators: Sasha Konecni sasha@msi-uk.com
team coordinators: flidr@CyberGate.zcu.cz flidr@CyberGate.zcu.cz
team coordinators: Hans Petter Bieker zerium@webindex.no
team coordinators: Piotr Roszatycki dexter@fnet.pl
team coordinators: Pedro Morais pmmm@camoes.rnl.ist.utl.pt
team coordinators: Elvis Pfützenreuter epx@netville.com.br
team coordinators: Paul Ionescu ipaul@romsys.ro
team coordinators: Denis Y. Pershin dyp@inetlab.com
team coordinators: Juraj Bednar bednar@isternet.sk mailling list: send a mail with 'subscribe' in the subject line to: sk-i18n@rak.isternet.sk
team coordinators: blazzupancic@hotmail.com blazzupancic@hotmail.com
team coordinators: Anders Widell d95-awi@nada.kth.se
team coordinators: Gorkem Cetin gorkem@linux.org.tr
team coordinators: Wang Jian larkw@263.net
team coordinators: Chou Yeh-Jyi ycchou@ccca.nctu.edu.tw
Next Previous Table of Contents