[Webkit-unassigned] [Bug 197213] New: [INTL] en-NZ locale defaults to en-US locale instead of using en-NZ

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 23 14:59:28 PDT 2019


            Bug ID: 197213
           Summary: [INTL] en-NZ locale defaults to en-US locale instead
                    of using en-NZ
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: daniel.compton.lists at gmail.com

When using Intl.DateTimeFormat/Intl.NumberFormat in the New Zealand locale (en-NZ), if you use Intl.DateTimeFormat() or Intl.DateTimeFormat("default"), JavaScriptCore resolves the locale to the en-US locale. This only seems to happen for New Zealand. When macOS is using the United Kingdom, USA, or Australia locales, JavaScriptCore returns the expected locale.

Reproduction steps:

* Open Language & Region in System Preferences
* Change the Region to the region under test
* Open a Safari web-page and the Web Inspector
* Run this statements in the Console:

[new Intl.DateTimeFormat("default").resolvedOptions().locale,
new Intl.DateTimeFormat().resolvedOptions().locale,
new Intl.DateTimeFormat().format(new Date())]

Current output:

// In the Australia region:
=> ["en-AU", "en-AU", "24/04/2019"]

// In United Kingdom
=> ["en-GB", "en-GB", "24/04/2019"]

// In United States
=> ["en-US", "en-US", "4/24/2019"]

// In New Zealand (this one shows the problem)
=> ["en-US", "en-US", "4/24/2019"]

Expected output for New Zealand:

["en-NZ", "en-NZ", "24/04/2019"]

JavaScriptCore does correctly format the output if the en-NZ locale is specified:

[new Intl.DateTimeFormat("en-NZ").resolvedOptions().locale,
new Intl.DateTimeFormat("en-NZ").format(new Date())]
=> ["en-NZ", "en-US", "24/04/2019"]

I would expect that the default locale returned by JavaScriptCore matches the system locale, especially where JavaScriptCore does support that locale like en-NZ. If en-NZ is not supported, then I would probably expect to default to en-AU, and failing that en-GB. Both of those locales are more similar to en-NZ than en-US is.

Tested in
Safari Technology Preview: Release 80 (Safari 12.2, WebKit 14608.1.16)
Safari: Version 12.1 (14607.

Other notes:

I tested this briefly in Chrome and Firefox for the NZ region. Chrome returns en-NZ as the default locale, Firefox has the same behaviour as Safari

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190423/93a26c8f/attachment.html>

More information about the webkit-unassigned mailing list