From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../unicode-bcp47-locale-ids-language-mappings.js | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 js/src/tests/non262/Intl/unicode-bcp47-locale-ids-language-mappings.js (limited to 'js/src/tests/non262/Intl/unicode-bcp47-locale-ids-language-mappings.js') diff --git a/js/src/tests/non262/Intl/unicode-bcp47-locale-ids-language-mappings.js b/js/src/tests/non262/Intl/unicode-bcp47-locale-ids-language-mappings.js new file mode 100644 index 0000000000..4f0a01a9cb --- /dev/null +++ b/js/src/tests/non262/Intl/unicode-bcp47-locale-ids-language-mappings.js @@ -0,0 +1,39 @@ +// |reftest| skip-if(!this.hasOwnProperty("Intl")) + +// For the most part the mappings from IANA are a subset of the CLDR mappings. +// So there are mappings which are consistent across both databases. +assertEq(Intl.getCanonicalLocales("iw")[0], "he"); + +// But some languages are mapped differently. +// +// From the IANA language data registry: +// Type: language +// Subtag: drh +// Description: Darkhat +// Added: 2009-07-29 +// Deprecated: 2010-03-11 +// Preferred-Value: khk +// +// From CLDR: +// +// +// because CLDR also maps macro-languages: +// +assertEq(Intl.getCanonicalLocales("drh")[0], "mn"); + +// CLDR maps macro-languages: +// +assertEq(Intl.getCanonicalLocales("cmn")[0], "zh"); + +// CLDR also contains mappings from ISO-639-2 (B/T) to 639-1 codes: +// +// +assertEq(Intl.getCanonicalLocales("dut")[0], "nl"); +assertEq(Intl.getCanonicalLocales("nld")[0], "nl"); + +// CLDR has additional mappings for legacy language codes. +// +assertEq(Intl.getCanonicalLocales("tl")[0], "fil"); + +if (typeof reportCompare === "function") + reportCompare(true, true); -- cgit v1.2.3