Closed Bug 1548877 Opened 1 year ago Closed 1 year ago

Number​..toLocale​String(locale) does not work correctly with certain locales

Categories

(Core :: JavaScript: Internationalization API, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1522070

People

(Reporter: emil, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.80 Chrome/71.0.3578.80 Safari/537.36

Steps to reproduce:

Consider the following JS expression: (123.456).toLocaleString("no"). It returns a string without comma as the decimal separator. Norwegian uses the comma as the decimal separator.

(123.456).toLocaleString("nb") and (123.456).toLocaleString("nn") both work however, which is correct. Both nb and nn has the macrolanguage no according to the language subtag registry https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry.

Expected results:

123,456

Hi, Im not entirely sure this is the correct component, but it seems like a good place to start, Please change the component to a more suitable one if this is not the correct one.

Assignee: nobody → bokmaal
Component: Untriaged → nb-NO / Norwegian Bokmål
Product: Firefox → Mozilla Localizations
Version: 64 Branch → unspecified
Assignee: bokmaal → nobody
Component: nb-NO / Norwegian Bokmål → Internationalization
Product: Mozilla Localizations → Core

That's not what I see in Firefox console. On which version are you trying?

(123.456).toLocaleString("no")
"123,456"
(123.456).toLocaleString("nb")
"123,456"
(123.456).toLocaleString("nn")
"123,456"

I also assume you meant thousand separator in comment 1 (not decimal)?

Flags: needinfo?(emil)

Side note: this data is not Mozilla's, it comes from CLDR (Unicode). If there are issues, they likely need to be reported upstream
https://github.com/unicode-cldr/cldr-numbers-full/tree/master/main

Component: Internationalization → JavaScript: Internationalization API

The language identifier no is currently not supported.

js> Intl.NumberFormat.supportedLocalesOf(["nb", "nn", "no"])
["nb", "nn"]

But bug 1522070 should fix this issue by mapping no to nb per CLDR.

Depends on: 1522070
Flags: needinfo?(emil)

The priority flag is not set for this bug.
:Waldo, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jwalden)

This is now fixed in Nightly. Dup'ing to bug 1522070 (see comment #4).

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1522070
Flags: needinfo?(jwalden)
You need to log in before you can comment on or make changes to this bug.