From 9854c1021bbd502109e2a0a53303b429211e1d91 Mon Sep 17 00:00:00 2001 From: Masahiro Fujimoto Date: Tue, 16 Mar 2021 17:06:42 +0900 Subject: Add Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/resolvedOptions to ja MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2021/02/20時点の英語版に基づき新規翻訳 --- .../intl/pluralrules/resolvedoptions/index.html | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/intl/pluralrules/resolvedoptions/index.html (limited to 'files/ja/web') diff --git a/files/ja/web/javascript/reference/global_objects/intl/pluralrules/resolvedoptions/index.html b/files/ja/web/javascript/reference/global_objects/intl/pluralrules/resolvedoptions/index.html new file mode 100644 index 0000000000..af0bb0c25c --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/intl/pluralrules/resolvedoptions/index.html @@ -0,0 +1,91 @@ +--- +title: Intl.PluralRules.prototype.resolvedOptions() +slug: Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/resolvedOptions +tags: +- Internationalization +- Intl +- JavaScript +- Localization +- Method +- PluralRules +- Prototype +- Reference +--- +
{{JSRef}}
+ +

The Intl.PluralRules.prototype.resolvedOptions() メソッドは、この {{jsxref("Collator")}} オブジェクトの初期化時に計算されたロケールと照合オプションを反映したプロパティを持つ新しいオブジェクトを返します。

+ +

構文

+ +
pluralRule.resolvedOptions()
+ +

返値

+ +

与えられた {{jsxref("PluralRules")}} オブジェクトの初期化時に計算されたロケールと照合オプションを反映したプロパティを持つ新しいオブジェクトです。

+ +

解説

+ +

返されるオブジェクトには以下のプロパティがあります。

+ +
+
locale
+
実際に使用したロケールの BCP 47 言語タグ。このロケールにつながる入力 BCP 47 言語タグに Unicode 拡張値が要求された場合、要求されたキーと値のペアのうち、このロケールで対応しているものが locale に含まれます。
+
pluralCategories
+
指定されたロケールで使用される複数形カテゴリーの {{jsxref("Array")}} で、 "zero", "one", "two", "few", "many", "other" のリストの中から選択します。
+
type
+
The type used (cardinal or ordinal).
+
+ +

以下の二つのプロパティのグループの中では、一つだけしか設定できません。

+ +
+
minimumIntegerDigits
+
minimumFractionDigits
+
maximumFractionDigits
+
これらのプロパティには、 options 引数で指定された値が入るか、既定値で埋められます。これらのプロパティは minimumSignificantDigitsmaximumSignificantDigits のどちらも options 引数で指定されなかった場合のみ存在します。
+
minimumSignificantDigits
+
maximumSignificantDigits
+
これらのプロパティには、 options 引数で指定された値が入るか、既定値で埋められます。これらのプロパティは、少なくとも1つのプロパティが options 引数で提供された場合にのみ表示されます。
+
+ +

+ +

resolvedOptions メソッドの使用

+ +
var de = new Intl.PluralRules('de-DE');
+var usedOptions = de.resolvedOptions();
+
+usedOptions.locale;                // "de-DE"
+usedOptions.maximumFractionDigits; // 3
+usedOptions.minimumFractionDigits; // 0
+usedOptions.minimumIntegerDigits;  // 1
+usedOptions.pluralCategories;      // Array [ "one", "other" ]
+usedOptions.type;                  // "cardinal"
+
+ +

仕様書

+ + + + + + + + + + + + +
仕様書
{{SpecName('ES Int Draft', + '#sec-intl.pluralrules.prototype.resolvedoptions', + 'Intl.PluralRules.prototype.resolvedOptions')}}
+ +

ブラウザーの互換性

+ +
{{Compat("javascript.builtins.Intl.PluralRules.resolvedOptions")}}
+ +

関連情報

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