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

WebAssembly Locale Enhancements

    XMLWordPrintable

Details

    • Epic
    • Resolution: Unresolved
    • P2: Important
    • 6.7
    • None
    • Core: Locales (i18n)
    • None

    Description

      What is the benefit? Why is this valuable?
      Currently the default unix locale is use in Qt for WebAssembly. This has the drawback of not honouring end users preferences (e.g. language, region or timezone)

      What are common use cases?
      Web assembly application using end users locale instead of default Unix.

      Technical information

      Seems Qt for webassembly is not using browser's locale for its instance of QLocale::system().

      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

        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
              productboard Productboard
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes