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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
---
title: Intl.PluralRules.supportedLocalesOf()
slug: Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf
tags:
- Internationalization
- Intl
- JavaScript
- Method
- PluralRules
- メソッド
- 国際化
translation_of: Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf
---
<div>{{JSRef}}</div>
<p><strong><code>Intl.PluralRules.supportedLocalesOf()</code></strong> メソッドは、ランタイムの既定のロケールで代替する必要なく複数形の書式で対応されているものを含む配列を返します。</p>
<h2 id="Syntax" name="Syntax">構文</h2>
<pre class="syntaxbox">Intl.PluralRules.supportedLocalesOf(<var>locales</var>[, <var>options</var>])</pre>
<h3 id="Parameters" name="Parameters">引数</h3>
<dl>
<dt><code><var>locales</var></code></dt>
<dd>BCP 47 言語タグを持つ文字列、またはそのような文字列の配列です。 <code>locales</code> 引数の一般的な形式については、 {{jsxref("Intl", "Intl のページ", "#ロケールの識別とネゴシエーション", 1)}}を参照してください。</dd>
<dt><code><var>options</var></code></dt>
<dd>
<p>省略可能です。以下のプロパティを持つことがあるオブジェクトです。</p>
<dl>
<dt><code>localeMatcher</code></dt>
<dd>使用するロケールの一致アルゴリズムです。指定可能な値は <code>lookup</code> および <code>best fit</code> で、既定値は <code>best fit</code> です。このオプションの詳細は、 {{jsxref("Intl", "Intl のページ", "#Locale_negotiation", 1)}}を参照してください。</dd>
</dl>
</dd>
</dl>
<h3 id="Return_value" name="Return_value">返値</h3>
<p>指定したロケールタグのサブセットを表す文字列の配列で、ランタイムの既定のロケールで代替する必要なく複数形の書式で対応されているものを含みます。</p>
<h2 id="Description" name="Description">解説</h2>
<p><code>locales</code> で提供されている言語タグのサブセットを含む配列を返します。返される言語タグは、ランタイムが複数形のロケールに対応しているもので、使用しているロケール照合アルゴリズムで一致しているとみなされているものです。</p>
<h2 id="Examples" name="Examples">例</h2>
<h3 id="Using_supportedLocalesOf" name="Using_supportedLocalesOf">supportedLocalesOf() の使用</h3>
<p>複数形の書式でインドネシア語とドイツ語に対応しており、バリ語に対応していないランタイムを想定すると、 <code>supportedLocalesOf</code> はインドネシア語とドイツ語の言語タグを変更せずに返しますが、 <code>pinyin</code> の照合は複数形の書式には関係なく、インドネシア語でも使用されません。ここでの <code>lookup</code> アルゴリズムの仕様に注意してください — バリ語話者のほとんどはインドネシア語も理解しているので、 <code>best fit</code> のマッチャーはインドネシア語がバリ語に適切に一致すると判断し、バリ語の言語タグも返すかもしれません。</p>
<pre class="brush: js">var locales = ['ban', 'id-u-co-pinyin', 'de-ID'];
var options = { localeMatcher: 'lookup' };
console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', '));
// → "id-u-co-pinyin, de-ID"
</pre>
<h2 id="Specifications" name="Specifications">仕様書</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">仕様書</th>
</tr>
<tr>
<td>{{SpecName('ES Int Draft', '#sec-intl.pluralrules.supportedlocalesof', 'Intl.PluralRules.supportedLocalesOf')}}</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
<div>
<p>{{Compat("javascript.builtins.Intl.PluralRules.supportedLocalesOf")}}</p>
</div>
<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
<li>{{jsxref("PluralRules", "Intl.PluralRules")}}</li>
</ul>
|