Qt API | Qtopia API | Qtopia Documentation |

## Qtopia - Internationalization

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.

### Program Internationalization

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 file Internationalization

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.

### Documentation Internationalization

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.

### Translating Qtopia to additional languages

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.

### How to localize Qtopia

1. Acquire `application-LanguageCode.ts` for each application.
2. Use Qt Linguist (from Qt 3) to translate the `.ts` files.

3. 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"]

4. Submit entire `.ts` file to Trolltech, you will receive feedback on all comments to unfinished items (usually by adding comments to the `.ts` files so that future translators are similarly informed), and implementations will be changed as necessary/possible (which should hopefully be sufficient to complete the translation).

### Qtopia and the Operating System

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.