mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 04:22:28 +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
Notes:
sideshowbarker
2024-07-17 08:55:16 +09:00
Author: https://github.com/trflynn89
Commit: aafcdc4c72
Pull-request: https://github.com/SerenityOS/serenity/pull/14585
6 changed files with 42 additions and 12 deletions
|
@ -36,12 +36,12 @@ describe("correct behavior", () => {
|
|||
});
|
||||
|
||||
test("numberingSystem option limited to known 'nu' values", () => {
|
||||
["latn", "arab"].forEach(numberingSystem => {
|
||||
["latn", "foo"].forEach(numberingSystem => {
|
||||
const en = new Intl.RelativeTimeFormat("en", { numberingSystem: numberingSystem });
|
||||
expect(en.resolvedOptions().numberingSystem).toBe("latn");
|
||||
});
|
||||
|
||||
["latn", "arab"].forEach(numberingSystem => {
|
||||
["latn", "foo"].forEach(numberingSystem => {
|
||||
const en = new Intl.RelativeTimeFormat(`en-u-nu-${numberingSystem}`);
|
||||
expect(en.resolvedOptions().numberingSystem).toBe("latn");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue