Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.11.1
-
None
Description
qmlscene, qml, but also QQmlApplicationEngine do allow automatic loading and installation of .qm files for the respective UI. This is done by checking QLocale::system().name().
There are two problems with that:
- QQmlApplicationEngine ignores any locale enforced by QLocale::setDefault()
- QLocale::system() is actually specifying the decimal/grouping characters and date/time formats specified in the system configuration panel, not the UI language.
The QLocale documentation therefore recommends using QLocale::uiLanguages() instead, by using the convenience method QTranslator::install(QLocale, ...)
One problematic side-effect about changing this though is that it ignores the language of the translation sources; that is, if the sources are in English, but there's no en.qm translation file, it might be that a secondary language translation is loaded.
Anyhow, for Qt we have been providing empty English translations, and should endorse our users to do so, too.
Attachments
Issue Links
- Is tested by
-
QTBUG-41977 QWidget dialogs in QtQuick app are translated to a different language
- Closed
- resulted from
-
QTBUG-7329 QLocale: add UI language property
- Closed
For Gerrit Dashboard: QTBUG-69196 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
233577,5 | Use QTranslator::install(QLocale, ...) everywhere | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
233579,7 | i18n examples: Add en translation dummies | 5.11 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
233580,2 | photoviewer: Use QLocale::uiLanguages() for finding translations | 5.11 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
234706,5 | photoviewer: Add en translation dummy | dev | qt/qtdoc | Status: MERGED | +2 | 0 |
234707,5 | photoviewer: Use QLocale::uiLanguages() for finding translations | dev | qt/qtdoc | Status: MERGED | +2 | 0 |
235625,4 | Preview: Use QTranslator::install(QLocale, ...) | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |