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

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

    XMLWordPrintable

Details

    • Windows
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ivan.solovev Ivan Solovev
            kkohne Kai Köhne
            Vladimir Minenko Vladimir Minenko
            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