[Webkit-unassigned] [Bug 265233] New: Intl.DisplayNames().of() API always returns "short" region name, ignoring "style" option value

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 21 23:48:43 PST 2023


https://bugs.webkit.org/show_bug.cgi?id=265233

            Bug ID: 265233
           Summary: Intl.DisplayNames().of() API always returns "short"
                    region name, ignoring "style" option value
           Product: WebKit
           Version: Safari 17
          Hardware: Mac (Apple Silicon)
                OS: macOS 13
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: kuba.zmudzinski at gmail.com

Created attachment 468721

  --> https://bugs.webkit.org/attachment.cgi?id=468721&action=review

API call in console

### Steps to reproduce the problem:

1.
const regionNames = new Intl.DisplayNames(["en"], {
  locale: "en",
  type: "region",
});

console.log(regionNames.of("HK"));
// logs "Hong Kong" instead of "Hong Kong SAR China"

2.
const longRegionNames = new Intl.DisplayNames(["en"], {
  locale: "en",
  type: "region",
  style: "long",
});
console.log(longRegionNames.of("HK"));
// logs "Hong Kong" instead of "Hong Kong SAR China"

### Problem Description:

According to the specification https://tc39.es/ecma402/#sec-intl-displaynames-constructor, Intl.displayNames().of() API should return "long" form of the region names by default.

In the current version of Safari, this API always returns the "short" version, even when "long" value is passed to "style" option.

Expected long form according to ICU module data - https://github.com/unicode-org/icu/blob/release-74-1/icu4c/source/data/region/en.txt#L138

Additional Comments:
There is no such issue on Node.js or Firefox. It is also present on Chrome browser - https://bugs.chromium.org/p/chromium/issues/detail?id=1504455.

-- 
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/20231122/e531657f/attachment.htm>


More information about the webkit-unassigned mailing list