Qt API | Qtopia API | Qtopia Documentation | ![]() |
Internationalizing Qtopia software is much the same as internationalizing any Qt-based software. See the Qt i18n documentation. You should be familiar with that documentation, the tr() macros, Qt Linguist, and the internationalization process in general before you proceed with this document.
The process of internationalization produces Qt message files (.qm files). For applications, these files must be placed as follows:
/opt/Qtopia/i18n/language/appname.qm
The language is an ISO 639 language code optionally followed by an underscore and an ISO 3166 territory, eg. "en", "en_GB", "ja", "ja_JP". The appname is the application executable filename.
For plugins, which are shared libraries, the files must be placed in the following directory:
/opt/Qtopia/i18n/language/pluginname.qm
The pluginname is the filename of the plugin shared object, without any extensions, but including "lib" if the plugin includes that prefix.
Locales suffixes are supported - so for example, your application may use British English, and then have a /opt/Qtopia/i18n/en_US/appname.qm file specifying some changes for American English. Translations with locale suffixes take precedence over translations without such suffixes.
Desktop files (eg. /opt/Qtopia/apps/Application/appname.desktop) follow the standard for those files - each value in the file can be internationalized. For example, the texteditor.desktop file begins like this:
[Desktop Entry] Comment=A Text Editing Program Exec=textedit Icon=TextEditor Type=Application MimeType=text/* Name=Text Editor Name[no]=Teksteditor Name[de]=Texteditor
These files are encoded in UTF-8.
On-line documentation for applications is written in the HTML subset supported by the Qt richtext widget. Such documentation files must be placed as follows:
English documentation:
/opt/Qtopia/help/html/appname-suffixes.html
Non-English documentation:
/opt/Qtopia/help/language/html/appname-suffixes.html
The -suffixes is optional. It always starts with "-" to avoid namespace conflicts.
These files are encoded in UTF-8.
Qtopia ships with a number of supported languages. To translate it to an additional language, you must perform the translation process described above for all the application, desktop files, and help documentation which you wish to have in the additional language. Additionally, you will need to translate the library texts, which are found in:
/opt/Qtopia/i18n/language/libqpe.qm
Qt Linguist supports incremental translation, which helps you keep track of any additional content which is added to Qtopia that needs translation.
Any strings which are ambiguous or otherwise unclear or suspect in any way should be translated to whatever degree is possible, but left in the unfinished state, and a comment should be appended to the translation in square brackets:
(ambiguous)
Source text
View
Translation
Vue [Noun or verb?]
(unclear / suspect)
Source text
%1:%2
Translation
%1:%2 [What is this? Note that in Fooish, the time
"14:30" is written "30foo14", except on Tuesday when it is
written "30bar14"]
Qtopia uses UTF8 for all file formats. System functions are also expected to use UTF8 encoding. For example, with $LANG set to "ja", strftime() must return a string in UTF8 encoding. Depending on the underlying operating system, this may require that "ja" be an alias for the "ja_JP.utf8" locale.
Copyright © 2001-2002 Trolltech | Trademarks | Qtopia version 1.7.0
|