WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED MOVED
265233
Intl.DisplayNames().of() API always returns "short" region name, ignoring "style" option value
https://bugs.webkit.org/show_bug.cgi?id=265233
Summary
Intl.DisplayNames().of() API always returns "short" region name, ignoring "st...
Jakub Żmudziński
Reported
2023-11-21 23:48:43 PST
Created
attachment 468721
[details]
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
.
Attachments
API call in console
(28.39 KB, image/png)
2023-11-21 23:48 PST
,
Jakub Żmudziński
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Karl Dubost
Comment 1
2023-11-23 17:30:43 PST
I don't know how the table is constructed. but that doesn't seem to be in WebKit.
https://searchfox.org/wubkat/search?q=Hong+Kong&path=&case=false®exp=false
Karl Dubost
Comment 2
2023-11-27 14:43:27 PST
Jake, Thanks for reporting. This is currently not controlled by the WebKit project. But it is tracked internally and being discussed inside Apple.
Radar WebKit Bug Importer
Comment 3
2023-11-28 23:49:12 PST
<
rdar://problem/118919063
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug