Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.4.2
-
None
-
-
18359e224 (dev), 02b75a088 (6.5)
Description
Summary of the issue
Its hard for document reader to come up with the way to implement multi-language functionalities using QML6 i18n framework, the documentation may mislead the reader.
Documents to improve
[Internationalization and Localization with Qt Quick | Qt 6.4|https://doc.qt.io/qt-6/qtquick-internationalization.html]
At section 9, it explains how to change language at runtime. It explains the technique by calling C/C++ methods. As the document is for QML, implementing them for general QML developer would be harder task. It might be better to explain Qt.uiLanguage which trigger language file reloading automatically when the property is changed.
(See: QQmlApplicationEnginePrivate::init() )
[QML Examples - Internationalization | Qt QML 6.4.1|https://doc.qt.io/qt-6/qtqml-qml-i18n-example.html]
This document explains automatic loading mechanism of translation files in QML runtime. It says: "The QML runtime automatically loads a translation from the i18n subdirectory of the root QML file, based on the system language." This "subdirectory of the root QML file" is a bit tricky phrase for CMakeLists.txt based applications. Though both QDS and QtCreator places root qml file under root directory of each project, when they come to qt resource system, they are stored under a pre-defined directory of Qt resource system. (root QML file is placed under Main directory for QDS and placed under project name directory for QtCreator), so i18n directory for storing translation files need to be placed under the directory. It may be better to add some additional description for helping
[Internationalization with Qt | Qt 6.4|https://doc.qt.io/qt-6/internationalization.html]
This doc demonstate the way to enable translation by calling app.installTranslator() function in main.cpp. I belive its better to introduce the automate translation file loading mechanism which can be executed by placing the .qm files under <root qml's root dir>/i18n.
Note
There are miltiple inconsistency for multi-language support in Qt6. I took a note for it.
About QML Multi-language support inconsistency - Qt Site Japan - Global Site
Attachments
Issue Links
- depends on
-
QTBUG-71856 Consolidate linguist examples
- Open
- relates to
-
QTBUG-109782 Update Qt Linguist Manual
- Closed
-
QTBUG-71876 Doc: Consolidate Internationalization documentation
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-110009 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
454723,2 | Doc: Update QML I18N example docs | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
456698,2 | Doc: Update QML I18N example docs | 6.5 | qt/qtdeclarative | Status: MERGED | +2 | 0 |