Bug 252239 - Currency number formatting in "en_DE" locale does not follow CLDR guidance
Summary: Currency number formatting in "en_DE" locale does not follow CLDR guidance
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 16
Hardware: Mac (Intel) macOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-02-14 06:33 PST by andrew
Modified: 2023-02-15 11:26 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andrew 2023-02-14 06:33:38 PST
https://cldr.unicode.org/translation/number-currency-formats/number-symbols

"For English regional locales (e.g. en_DE) where English is not the primary language of the country/region (e.g. en_DE; English as used in Germany), the number formats and date formats should follow the English formatting usage in that country/region. Often, the formatting usage in English tend to follow the British or American formatting rather than the formatting of the primary language. Consult with the English versions of prominent magazines or newspapers for guidance on date and number format usage."

Steps to Reproduce:
1. Execute the following script in the JavaScript console in Safari 16.x:
Number('1234.5').toLocaleString('en-DE', {style: 'currency', currency: 'EUR'});

Expected behavior:
Returns '€1,234.50' (same as V8 and SpiderMonkey)

Actual behavior:
Returns '1.234,50 €'
Comment 1 Radar WebKit Bug Importer 2023-02-15 11:06:17 PST
<rdar://problem/105505430>
Comment 2 Yusuke Suzuki 2023-02-15 11:26:36 PST
(In reply to andrew from comment #0)
> https://cldr.unicode.org/translation/number-currency-formats/number-symbols
> 
> "For English regional locales (e.g. en_DE) where English is not the primary
> language of the country/region (e.g. en_DE; English as used in Germany), the
> number formats and date formats should follow the English formatting usage
> in that country/region. Often, the formatting usage in English tend to
> follow the British or American formatting rather than the formatting of the
> primary language. Consult with the English versions of prominent magazines
> or newspapers for guidance on date and number format usage."
> 

This happens only when there is no specific locale data (en-DE currency data in CLDR), and happens when we need to fallback to the other locale's formatting. (This is describing how that algorithm works when there is no appropriate locale). And this is suboptimal since it is better that we have a tailored formatting.

While CLDR does not have en-DE specific formatting for currency, AppleICU has the en-DE specific formatting which is more appropriate for English in DE region.
And in this en_DE, '1.234,50 €' is more appropriate output.

So, please file a bug to CLDR. BTW, AppleICU data is OSS at https://github.com/apple-oss-distributions/ICU