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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
---
title: Intl.Locale
slug: Web/JavaScript/Reference/Global_Objects/Intl/Locale
tags:
- Class
- Internationalization
- Intl
- JavaScript
- Reference
- クラス
- 国際化
translation_of: Web/JavaScript/Reference/Global_Objects/Intl/Locale
---
<div>{{JSRef}}</div>
<p><span class="seoSummary"><strong><code>Intl.Locale</code></strong> オブジェクトは、 Unicode ロケール識別子を表す Intl オブジェクトの標準組み込みプロパティです。</span></p>
<div>{{EmbedInteractiveExample("pages/js/intl-locale.html")}}</div>
<h2 id="Description" name="Description">解説</h2>
<p><code><strong>Intl.Locale</strong></code> オブジェクトは、 Unicode ロケールをより簡単に操作できるようにするために作成されました。 Unicode は、ロケールを<em>ロケール識別子</em>と呼ばれる文字列で表します。ロケール識別子は、<em>言語識別子</em>と<em>拡張タグ</em>から構成されます。言語識別子はロケールの中核となるもので、<em>言語</em>、<em>文字体系</em>、<em>地域サブタグ</em>から構成されます。ロケールに関する追加情報は、オプションの拡張タグに格納されます。<em>拡張タグ</em>には、暦の種類や時計の種類、数値表記法の種類などのロケールに関する情報が格納されています。</p>
<p>従来、 Intl API は Unicode と同様に文字列を使用してロケールを表していました。これはシンプルで軽量な解決策であり、うまく機能します。しかし、 Locale クラスを追加することで、言語、文字体系、地域、拡張タグの解析や操作が容易になります。</p>
<h2 id="Constructor" name="Constructor">コンストラクター</h2>
<dl>
<dt>{{jsxref("Locale/Locale", "Intl.Locale()")}}</dt>
<dd>新しい <code>Locale</code> オブジェクトを生成します。</dd>
</dl>
<h2 id="Properties" name="Properties">プロパティ</h2>
<dl>
<dt><code>Intl.Locale.prototype</code></dt>
<dd><code>Locale</code> コンストラクターのプロトタイプオブジェクトです。</dd>
</dl>
<h2 id="Instance_properties" name="Instance_properties">インスタンスプロパティ</h2>
<dl>
<dt>{{jsxref("Locale/baseName", "Intl.Locale.prototype.baseName")}}</dt>
<dd>この <code>Locale</code> に関する基本的な情報を、完全なデータ文字列の部分文字列の形で返します。</dd>
<dt>{{jsxref("Locale/calendar", "Intl.Locale.prototype.calendar")}}</dt>
<dd>このロケールの暦年を示す <code>Locale</code> の部分を返します。</dd>
<dt>{{jsxref("Locale/caseFirst", "Intl.Locale.prototype.caseFirst")}}</dt>
<dd>ロケールの照合規則に大文字・小文字を考慮しているかどうかを返します。</dd>
<dt>{{jsxref("Locale/collation", "Intl.Locale.prototype.collation")}}</dt>
<dd>この <code>Locale</code> の照合の種類を返します。これは、ロケールの規則に従って文字列を並べ替えるために使用します。</dd>
<dt>{{jsxref("Locale/hourCycle", "Intl.Locale.prototype.hourCycle")}}</dt>
<dd>このロケールが使用している時刻保持書式の規約を返します。</dd>
<dt>{{jsxref("Locale/language", "Intl.Locale.prototype.language")}}</dt>
<dd>このロケールに関連づけられた言語を返します。</dd>
<dt>{{jsxref("Locale/numberingSystem", "Intl.Locale.prototype.numberingSystem")}}</dt>
<dd>このロケールが使用している数値表記法を返します。</dd>
<dt>{{jsxref("Locale/numeric", "Intl.Locale.prototype.numeric")}}</dt>
<dd>このロケールが数字に対して特殊な照合順序を持っているかどうかを返します。</dd>
<dt>{{jsxref("Locale/region", "Intl.Locale.prototype.region")}}</dt>
<dd>このロケールに関連付けられた世界の地域 (通常は国) を返します。</dd>
<dt>{{jsxref("Locale/script", "Intl.Locale.prototype.script")}}</dt>
<dd>このロケールで使われている特定の言語を書く際に使用する文字体系を返します。</dd>
</dl>
<h2 id="Instance_methods" name="Instance_methods">インスタンスメソッド</h2>
<dl>
<dt>{{jsxref("Locale/minimize", "Intl.Locale.prototype.minimize()")}}</dt>
<dd>既存の値に基づいて、ロケールの言語、表記法、地域の最も可能性の高い値を取得します。</dd>
<dt>{{jsxref("Locale/maximize", "Intl.Locale.prototype.maximize()")}}</dt>
<dd>既存の値に基づいて、ロケールの言語、表記法、地域の最も可能性の高い値を取得します。</dd>
<dt>{{jsxref("Locale/toString", "Intl.Locale.prototype.toString()")}}</dt>
<dd>このロケールの完全なロケール識別子文字列を返します。</dd>
</dl>
<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', '#locale-objects')}}</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
<div>
<p>{{Compat("javascript.builtins.Intl.Locale")}}</p>
</div>
<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
<li><a href="https://github.com/zbraniecki/Intl.js/tree/intllocale">The Intl.Locale Polyfill</a></li>
<li><a href="https://www.unicode.org/reports/tr35/#Canonical_Unicode_Locale_Identifiers">Unicode locale identifiers spec</a></li>
</ul>
|