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

Qt for webassembly doesn't use browser's locale for its QLocale::system()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7
    • 6.5.2
    • Core: Locales (i18n)
    • None
    • WebAssembly
    • 63fc3175b (dev)

    Description

      According to here:

      https://stackoverflow.com/a/31135571

      Browser's locale can be determined with navigator.languages api which will return an array of user's locales (from the most preferred to the least preferred).

      I have attached a small project that reproduces this issue.

      You may need to change your browser's locale for this to work, for instance in firefox I add the user language "Portuguese-Portugal" and then I move it to top to get it as the preferred locale afaik. navigator.languages then return pt-PT as the first element.

      Attachments

        1. BrowserLocaleNotRespectedProject.zip
          2 kB
          Random Guy
        2. image-2023-08-30-14-51-13-577.png
          23 kB
          Random Guy
        3. image-2024-02-29-13-44-17-018.png
          40 kB
          Random Guy
        4. image-2024-02-29-13-45-53-522.png
          53 kB
          Random Guy
        5. image-2024-02-29-13-50-34-108.png
          24 kB
          Random Guy
        6. image-2024-02-29-13-54-18-467.png
          39 kB
          Random Guy
        7. image-2024-02-29-14-01-27-691.png
          28 kB
          Random Guy

        Issue Links

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

          Activity

            People

              sorvig Morten Sørvig
              qtuser32 Random Guy
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes