The functionality in Qt Quick Ultralite is based on Internationalization and Localization in Qt Quick and Qt Linguist . This document describes the differences, enhancements, and limitations compared to Qt Quick.
function in QML files to mark string literals for translation. All such marked string literals are found by the Qt Linguist tool, which generates the translation source file (
) containing those strings.
Once translations are made, there will a
file for each language. These files are compiled to translation release files (
) and passed to the QML compiler, which will replace each
call with a lookup of the correct string based on the
property can also be used in other bindings to make decisions based on the active language. Frequently this is used for choosing localized images.
example shows use of
List the translation source files for the target languages in the
CMake function. This has two effects:
update_translationsCMake target which is not included in the default build. Trigger a build of this target to create or update the
.tsfiles with new and changed translatable strings from the source code.
.tsfiles in the program binary.
file introduces a translated language that can be switched to at runtime by setting the
property. The name of the language is derived from the name of the
file. For example, the "app.nb_NO.ts" file defines the translations for
, which is the ISO language code for Norwegian Bokmål.
is empty, no translation is applied and the strings used in the source code are shown.
If an application does not support multiple languages, use the
option in the
CMake function and pass the
file for the target language.
The following functionality is not currently supported: