Qtopia Home · Home · Reference · User Guide · Internals

Internationalization (build system)

When Qtopia is configured there are two important variables that are set.

The build system uses the TRANSLATABLES variable to help facilitate a single set of translations across a number of products and configurations. Conditional source should be added to the TRANSLATABLES variable even if the condition is false.

Qtopia currently assumes that strings are written in the en_US language. Because of this assumption the build system sets STRING_LANGUAGE to en_US. The build system's internal variables TRANSLATIONS and ALL_TRANSLATIONS are set from LANGUAGES and AVAILABLE_LANGUAGES but without the value in STRING_LANGUAGE. This happens just after the .pro file is read so that any changes to LANGUAGES and AVAILABLE_LANGUAGES in the .pro file are taken into account.

    # Set TRANSLATIONS and ALL_TRANSLATIONS
    TRANSLATIONS=$$LANGUAGES
    TRANSLATIONS-=$$STRING_LANGUAGE
    ALL_TRANSLATIONS=$$AVAILABLE_LANGUAGES
    ALL_TRANSLATIONS-=$$STRING_LANGUAGE

While it is generally assumed that STRING_LANGUAGE is both available and selected this does not have to be the case. Qtopia can be configured without support for en_US.

Third party apps will most likely have translations available for a different set of languages than what the SDK ships with. They should specify these translations like this.

    # Specify the languages that make lupdate should produce .ts files for
    AVAILABLE_LANGUAGES=en_US
    # Specify the langauges we want to install translations for
    LANGUAGES=$$AVAILABLE_LANGUAGES

See also Overviews, hint=nct, Non-code Translatables, and Internationalization.


Copyright © 2008 Nokia Qtopia Build System Documentation