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