Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.10.1, 5.12.0
-
None
-
MacOS Mojave(10.14.1)/High Sierra(10.13.2), Qt 5.10.1/5.12.0
Description
Getting the system locale with QLocale::system() is returning the wrong language on MacOS Mojave. When changing both the system language and region, the locale name returned by Qt will correctly update the region but the language is always English.
Language and region both changed to German in system preferences:
QLocale::system().name() returns "en_DE" - gets the region change correct but language is stuck on English
I found that opening the application's info.plist file and changing the CFBundleDevelopmentRegion key to German (or de_DE) will then cause the app to start up in German. This will also persist if I switch the system language back to English, so this setting is overriding the system language. Removing this setting from info.plist also works on 10.14, but on 10.13 this then causes the app to revert back to English (with the region still set to Germany), even if the system locale is set to German. I tried various combinations of system locale settings, CFBundleDevelopmentRegion values in the application, and OS versions. The discrepancies are highlighted
System locale | CFBundleDevelopmentRegion (Info.plist) | Qlocale::system().name() (10.14.1 / 10.13) |
---|---|---|
English/US | English / en_US | en_US / en_US |
English/US | German | de_DE / en_US |
English/US | de_DE | de_DE / de_DE |
English/US | <removed> | en_US / en_US |
German/Germany | English | en_DE / de_DE |
German/Germany | en_US | en_DE / en_DE |
German/Germany | German / de_DE | de_DE / de_DE |
German/Germany | <removed> | de_DE / en_DE |
English/UK | English / en_US | en_GB / en_GB |
English/UK | German | de_DE / en_GB |
English/UK | de_DE | de_DE / de_DE |
English/UK | <removed> | en_GB / en_GB |
I tried rebuilding the application with Qt 5.12.0 and found no change in any of this behavior
Attachments
Issue Links
- depends on
-
QTBUG-94460 QLocale's names for languages, scripts and territories don't match CLDR's en.xml's proper names
- Closed
- duplicates
-
QTBUG-63324 iOS/macOS: system localization always returns english language
- Closed