Welcome to mirror list, hosted at ThFree Co, Russian Federation.

grandfathered_tags_without_preferred_value.js « general « intl « test « v8 « deps - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b4d529652f684a2de1cf6c21f8ffd8d98e9b6401 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

[
  // Grandfathered tags without a preferred value in the IANA language
  // tag registry. Nonetheless, ICU cooks up a value when canonicalizing.
  // v8 works around that ICU issue.
  // See https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry .
  ["cel-gaulish", "cel-gaulish"],
  ["i-default", "i-default"],
  ["i-mingo", "i-mingo"],
  ["i-enochian", "i-enochian"],
  ["zh-min", "zh-min"],

  // Matching should be case-insensitive.
  ["I-default", "i-default"],
  ["i-DEFAULT", "i-default"],
  ["I-DEFAULT", "i-default"],
  ["i-DEfauLT", "i-default"],
  ["zh-Min", "zh-min"],
  ["Zh-min", "zh-min"],
].forEach(([inputLocale, expectedLocale]) => {
  const canonicalLocales = Intl.getCanonicalLocales(inputLocale);
  assertEquals(canonicalLocales.length, 1);
  assertEquals(canonicalLocales[0], expectedLocale);
})