From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../intl/getcanonicallocales/index.html | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/intl/getcanonicallocales/index.html (limited to 'files/ja/web/javascript/reference/global_objects/intl/getcanonicallocales') diff --git a/files/ja/web/javascript/reference/global_objects/intl/getcanonicallocales/index.html b/files/ja/web/javascript/reference/global_objects/intl/getcanonicallocales/index.html new file mode 100644 index 0000000000..1d85e32e87 --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/intl/getcanonicallocales/index.html @@ -0,0 +1,74 @@ +--- +title: Intl.getCanonicalLocales() +slug: Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales +tags: + - Internationalization + - Intl + - JavaScript + - Method +translation_of: Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales +--- +
{{JSRef}}
+ +

Intl.getCanonicalLocales() メソッドは、正規のロケール名を含む配列を返します。重複は省略され、要素は構造的に有効な言語タグとして検証されます。

+ +
{{EmbedInteractiveExample("pages/js/intl-getcanonicallocales.html")}}
+ + + +

構文

+ +
Intl.getCanonicalLocales(locales)
+ +

引数

+ +
+
locales
+
標準ロケール名を取得するための {{jsxref("String")}} 値リスト。
+
+ +

返値

+ +

正規のロケール名を含む配列です。

+ +

+ +

getCanonicalLocales の使用

+ +
Intl.getCanonicalLocales('EN-US'); // ["en-US"]
+Intl.getCanonicalLocales(['EN-US', 'Fr']); // ["en-US", "fr"]
+
+Intl.getCanonicalLocales('EN_US');
+// RangeError:'EN_US' is not a structurally valid language tag
+
+ +

仕様書

+ + + + + + + + + + + + +
仕様書
{{SpecName('ES Int Draft', '#sec-intl.getcanonicallocales', 'Intl.getCanonicalLocales')}}
+ +

ブラウザーの互換性

+ +
+ + +

{{Compat("javascript.builtins.Intl.getCanonicalLocales")}}

+
+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf