aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/javascript/reference/global_objects/intl/pluralrules/select/index.html
blob: 73548e8caeb7ef8564807e68242e36f6a6c84daa (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
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
82
---
title: Intl.PluralRules.select()
slug: Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/select
tags:
  - Internationalization
  - Intl
  - JavaScript
  - Method
  - PluralRules
  - メソッド
  - 国際化
translation_of: Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/select
---
<div>{{JSRef}}</div>

<p><strong><code>Intl.PluralRules.prototype.select</code></strong> メソッドは、ロケールを考慮した書式設定に使用する複数形ルールを示す String を返します。</p>

<h2 id="Syntax" name="Syntax">構文</h2>

<pre class="syntaxbox notranslate"><code><var>pluralCategory = pluralRule</var>.select(<var>number</var>)</code></pre>

<h3 id="Parameters" name="Parameters">引数</h3>

<dl>
 <dt><code>number</code></dt>
 <dd>複数のルールを取得するための数値です。</dd>
</dl>

<h3 id="Return_value" name="Return_value">返値</h3>

<p>数字の複数形のカテゴリを表す <code>string</code> で、 <code>zero</code>, <code>one</code>, <code>two</code>, <code>few</code>, <code>many</code>, <code>other</code> のいずれかになります。</p>

<h2 id="Description" name="Description">解説</h2>

<p>この関数は、 {{jsxref("PluralRules")}} オブジェクトのロケールや書式オプションに応じて、複数形のカテゴリを選択します。</p>

<h2 id="Examples" name="Examples"></h2>

<h3 id="Using_select" name="Using_select">select() の使用</h3>

<pre class="brush: js notranslate"> new Intl.PluralRules('ar-EG').select(0);
// → 'zero'

new Intl.PluralRules('ar-EG').select(1);
// → 'one'

new Intl.PluralRules('ar-EG').select(2);
// → 'two'

new Intl.PluralRules('ar-EG').select(6);
// → 'few'

new Intl.PluralRules('ar-EG').select(18);
// → 'many'
</pre>

<h2 id="Specifications" name="Specifications">仕様書</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">仕様書</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('ES Int Draft', '#sec-intl.pluralrules.prototype.select', 'Intl.PluralRules.select()')}}</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>

<div>
<p>{{Compat("javascript.builtins.Intl.PluralRules.select")}}</p>
</div>

<h2 id="See_also" name="See_also">関連情報</h2>

<ul>
 <li>{{jsxref("PluralRules", "Intl.PluralRules")}}</li>
</ul>