Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
6.1.1
-
None
-
-
8
-
51e8d3592acc8bacf326fe3933b5dec13bb518e6 (qt/qtbase/dev) 20ef130f3a55f24dfba09f3a3e49d73ab7e6869f (qt/qtbase/6.2)
-
Team 1 Foundation_Sprint 42, Team 1 Foundation_Sprint 43
Description
QLocale::uiLanguages() on Windows does seem to only return the system UI language, not the full list of 'preferred' languages that can be set in the Windows system:
This is because of the Win32 API used. QLocale uses GetUserPreferredUILanguages() , which seem to return only one or two languages (see also https://stackoverflow.com/questions/52849233/getuserpreferreduilanguages-never-returns-more-than-two-languages ).
An alternative is to use the WinRT API, GlobalizationPreferences::Languages().
Output from attached test app:
QLocale()::uiLanguages() QList("en-US") win32_uilanguages QList("en-US") winrt_uilanguages QList("de-DE", "en-GB", "en-US", "en-DE")
Can we consider supporting the winrt API?
Attachments
For Gerrit Dashboard: QTBUG-94341 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
371611,10 | Let QLocale::uiLanguages() use WinRT API when possible | dev | qt/qtbase | Status: MERGED | -1 | 0 |
374669,2 | Let QLocale::uiLanguages() use WinRT API when possible | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |
376245,5 | Guard WinRT API code for clang-cl | dev | qt/qtbase | Status: MERGED | +2 | 0 |
376475,2 | Guard WinRT API code for clang-cl | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |