mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:07:45 +00:00
LibJS: Allow specifying keyword values not directly defined for a locale
For example, consider the locales "en-u-nu-fullwide" or "en-u-nu-arab". The CLDR only declares the "latn" numbering system for the "en" locale, thus ResolveLocale would change the locale to "en-u-nu-latn". This patch allows using non-latn numbering systems digits.
This commit is contained in:
parent
b24b9c0a65
commit
aafcdc4c72
6 changed files with 42 additions and 12 deletions
|
@ -64,12 +64,12 @@ describe("correct behavior", () => {
|
|||
});
|
||||
|
||||
test("numberingSystem option limited to known 'nu' values", () => {
|
||||
["latn", "arab"].forEach(numberingSystem => {
|
||||
["latn", "foo"].forEach(numberingSystem => {
|
||||
const en = Intl.DateTimeFormat("en", { numberingSystem: numberingSystem });
|
||||
expect(en.resolvedOptions().numberingSystem).toBe("latn");
|
||||
});
|
||||
|
||||
["latn", "arab"].forEach(numberingSystem => {
|
||||
["latn", "foo"].forEach(numberingSystem => {
|
||||
const en = Intl.DateTimeFormat(`en-u-nu-${numberingSystem}`);
|
||||
expect(en.resolvedOptions().numberingSystem).toBe("latn");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue