blob: bc1f9a65653eb68a69a05c248128ae507d04cb86 (
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
83
84
85
|
---
title: Intl.Collator.prototype.resolvedOptions()
slug: Web/JavaScript/Reference/Global_Objects/Intl/Collator/resolvedOptions
tags:
- Collator
- Internationalization
- Intl
- JavaScript
- Method
- Prototype
translation_of: Web/JavaScript/Reference/Global_Objects/Intl/Collator/resolvedOptions
---
<div>{{JSRef}}</div>
<p><strong><code>Intl.Collator.prototype.resolvedOptions()</code></strong> メソッドは、この {{jsxref("Collator")}} オブジェクトの初期化時に計算されたロケールと照合オプションを反映したプロパティを持つ新しいオブジェクトを返します。</p>
<div>{{EmbedInteractiveExample("pages/js/intl-collator-prototype-resolvedoptions.html")}}</div>
<div class="hidden">このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力していただける場合は、 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> をクローンしてプルリクエストを送信してください。</div>
<h2 id="Syntax" name="Syntax">構文</h2>
<pre class="syntaxbox notranslate"><var>collator</var>.resolvedOptions()</pre>
<h3 id="Return_value" name="Return_value">返値</h3>
<p>この {{jsxref("Collator")}} オブジェクトの初期化時に計算されたロケールと照合オプションを反映したプロパティを持つ新しいオブジェクトです。</p>
<h2 id="Description" name="Description">解説</h2>
<p>返されるオブジェクトには以下のプロパティがあります。</p>
<dl>
<dt><code>locale</code></dt>
<dd>実際に使用したロケールの BCP 47 言語タグ。このロケールにつながる入力 BCP 47 言語タグに Unicode 拡張値が要求された場合、要求されたキーと値のペアのうち、このロケールで対応しているものが <code>locale</code> に含まれます。</dd>
<dt><code>usage</code></dt>
<dt><code>sensitivity</code></dt>
<dt><code>ignorePunctuation</code></dt>
<dd><code>options</code> 引数の同名のプロパティで提供された値、または既定値が入ります。</dd>
<dt><code>collation</code></dt>
<dd><code>locale</code> が対応している場合は、 Unicode 拡張キー <code>"co"</code> を使用して要求された値、そうでなければ <code>"default"</code> です。</dd>
<dt><code>numeric</code></dt>
<dt><code>caseFirst</code></dt>
<dd><code>options</code> 引数の同名のプロパティ、または Unicode 拡張キーの <code>"kn"</code> および <code>"kf"</code> で要求された値、または既定値が入ります。実装がこれらのプロパティに対応していない場合は、省略されます。</dd>
</dl>
<h2 id="Examples" name="Examples">例</h2>
<h3 id="Using_the_resolvedOptions_method" name="Using_the_resolvedOptions_method">resolvedOptions メソッドの使用</h3>
<pre class="brush: js notranslate">var de = new Intl.Collator('de', { sensitivity: 'base' })
var usedOptions = de.resolvedOptions();
usedOptions.locale; // "de"
usedOptions.usage; // "sort"
usedOptions.sensitivity; // "base"
usedOptions.ignorePunctuation; // false
usedOptions.collation; // "default"
usedOptions.numeric; // false
</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.collator.prototype.resolvedoptions', 'Intl.Collator.prototype.resolvedOptions')}}</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
<div>
<p>{{Compat("javascript.builtins.Intl.Collator.resolvedOptions")}}</p>
</div>
<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
<li>{{jsxref("Collator", "Intl.Collator")}}</li>
</ul>
|