Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-94341

Windows: Let QLocale::uiLanguages() return all preferred languages

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 6.1.1
    • Fix Version/s: 6.2.1, 6.3.0 Alpha
    • Component/s: Core: Locales (i18n)
    • Labels:
      None
    • Platform/s:
      Windows
    • Commits:
      51e8d3592acc8bacf326fe3933b5dec13bb518e6 (qt/qtbase/dev) 20ef130f3a55f24dfba09f3a3e49d73ab7e6869f (qt/qtbase/6.2)
    • Story Points:
      8
    • Sprint:
      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

          Activity

            People

            Assignee:
            ivan.solovev Ivan Solovev
            Reporter:
            kkohne Kai Köhne
            PM Owner:
            Vladimir Minenko Vladimir Minenko
            RnD Owner:
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes