Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
6.5
-
None
-
-
69fce1185 (dev), e0eb137af (6.6), 204b47558 (tqtc/lts-6.5)
Description
Hi,
I have found that now you can do easily dynamic translation, relying on the QQmlApplicationEngine (https://doc.qt.io/qt-6/qqmlapplicationengine.html#details). However when I tried to create an empty project with the template from Qt Creator 11 for Qt 6.5, I could not have my string translated (event using qm_fr.ts notations, adding manually the files in qt_add_translations())
Then I found out too that since 6.5 there is an example qml/qml-i18n to support the documentation but it does not use the approach you have when you create an empty project:
- why using engine.load() and not engine.loadFromModule()
- why using NO_RESOURCE_TARGET_PATH in the qt_add_qml_module()
I think this is really nice how simply you can use dynamic translations with Qt 6.5 now but I would like to be aware of the limitations, what is really needed and so on...
I think the following parts could be a bit detailed and maybe referencing between each other too:
https://doc.qt.io/qt-6/qml-qtqml-qt.html#uiLanguage-prop
https://doc.qt.io/qt-6/i18n-source-translation.html#qml-use-qqmlapplicationengine
Attachments
Issue Links
- relates to
-
QTBUG-116589 Dynamic translations seem not working with QQmlApplicationEngine::loadFromModule()
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-116588 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
513590,2 | QML: Fix i18n example | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
513921,3 | QML: Fix i18n example | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
514118,2 | QML: Fix i18n example | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |