C
Localization: Localize Safety-Critical Content
Localization demonstrates how you can localize content in safety-critical QML elements. Localization is a standalone example.
For localization support, you need to define SAFE_LANGUAGES
, SAFE_TRANSLATION
, and TRANSLATIONS
variables in the CMakeLists.txt or in the project file as instructed in Enabling Localization.
Qt Safe Renderer generates separate layout data files for each locale. See an example of the generated data under <Qt installation directory>/Examples/QtSafeRenderer-<version>/saferenderer/localization/layoutData/SafeUI.
The following topics provide more information about localization in Qt:
Building and Running Localization
You can build the example for the host platform, QNX, INTEGRITY, and Embedded Linux.
To build and run the project, opent the project in Qt Creator's Edit mode and select Build > Run.
By default, when you select Build > Run in Qt Creator for your project, Qt Creator builds the project, deploys it to the device defined in the kit, and runs it there. However, if you have not made any changes to the project since you last built and deployed it, Qt Creator simply runs it again. For more information, see Building and Running topic in Qt Creator Manual.
Following topics provide target-specific instructions about building projects:
- Building Projects with Qt Creator (the host platform)
- Building for QNX
- Building for INTEGRITY
- How to Create Boot to Qt Image (Embedded Linux)
Example Files
Files:
- saferenderer/localization/CMakeLists.txt
- saferenderer/localization/SafeUI.qml
- saferenderer/localization/images.qrc
- saferenderer/localization/localization.pro
- saferenderer/localization/main.cpp
- saferenderer/localization/qml.qrc
- saferenderer/localization/safeasset.qrc
Images:
- saferenderer/localization/flags/ar.png
- saferenderer/localization/flags/da.png
- saferenderer/localization/flags/de.png
- saferenderer/localization/flags/el.png
- saferenderer/localization/flags/et.png
- saferenderer/localization/flags/fi.png
- saferenderer/localization/flags/gb.png
- saferenderer/localization/flags/no.png
- saferenderer/localization/flags/sv.png
- saferenderer/localization/flags/uk.png
Available under certain Qt licenses.
Find out more.