Details
-
Epic
-
Resolution: Unresolved
-
P2: Important
-
None
-
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
- blocks
-
QTBUG-116613 Qt for webassembly doesn't use browser's locale for its QLocale::system()
- Closed
- relates to
-
QTBUG-118245 Implement time-zone backend for WASM based on ES's Temporal
- Reported