New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intl.DisplayNames script does not work #2622
Intl.DisplayNames script does not work #2622
Comments
i think it's better to be part of documentation. |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=Intl.DisplayNames%2CIntl.DisplayNames.~locale.en%2CIntl.RelativeTimeFormat%2CIntl.ListFormat%2CIntl.NumberFormat%2CIntl.RelativeTimeFormat.~locale.en%2CIntl.ListFormat.~locale.en%2CIntl.NumberFormat.~locale.en"></script>
</head>
<body>
<script>
console.log(new Intl.DisplayNames('en-US', { type: 'region' }).of('IR')) // OK
console.log(new Intl.DisplayNames('en-US', { type: 'language' }).of('fa')) // OK
console.log(new Intl.DisplayNames('en-US', { type: 'currency' }).of('IRR')) // OK
console.log(new Intl.DisplayNames('en-US', { type: 'script' }).of('arab')) // WRONG `arab` must be "Arabic"
</script>
</body>
</html> https://jsbin.com/fitosabuba/edit?html,console,output |
|
It's bug, follow ICU/Intl not chrome. https://bugs.chromium.org/p/chromium/issues/detail?id=1176979 ICU/Intl could be cross check using different implementation, easy and most mature implementation is PHP version. <?php
echo locale_get_display_script('ar-Arab-EG', 'en'); // Arabic PHP using libicu since version 5 and it's mature enough to be good point for check. |
hmm most non-web envs use |
Latest version should have this fix. |
How can i use as CDN package?
Older browser seems not support to esm module so we need add
The text was updated successfully, but these errors were encountered: