--- 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
使用される種類です (cardinal または 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")}}

関連情報