diff options
author | MDN <actions@users.noreply.github.com> | 2021-07-09 00:38:08 +0000 |
---|---|---|
committer | MDN <actions@users.noreply.github.com> | 2021-07-09 00:38:08 +0000 |
commit | 235c34993c7b14f783fc8259cc237ac09f0d3e57 (patch) | |
tree | 7bee1bfcdc5216423bb76a12842eb60c169b0b04 /files/ja/orphaned/web/api/navigatorlanguage/language/index.html | |
parent | 635bcdc09c53e3c497a3ff8eb958ca8eb541c7fd (diff) | |
download | translated-content-235c34993c7b14f783fc8259cc237ac09f0d3e57.tar.gz translated-content-235c34993c7b14f783fc8259cc237ac09f0d3e57.tar.bz2 translated-content-235c34993c7b14f783fc8259cc237ac09f0d3e57.zip |
[CRON] sync translated content
Diffstat (limited to 'files/ja/orphaned/web/api/navigatorlanguage/language/index.html')
-rw-r--r-- | files/ja/orphaned/web/api/navigatorlanguage/language/index.html | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/files/ja/orphaned/web/api/navigatorlanguage/language/index.html b/files/ja/orphaned/web/api/navigatorlanguage/language/index.html new file mode 100644 index 0000000000..1fd6c7b55f --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorlanguage/language/index.html @@ -0,0 +1,66 @@ +--- +title: window.navigator.language +slug: orphaned/Web/API/NavigatorLanguage/language +tags: + - API + - Language + - NavigatorLanguage + - Property + - Read-only + - Reference +translation_of: Web/API/NavigatorLanguage/language +original_slug: Web/API/NavigatorLanguage/language +--- +<div>{{APIRef("HTML DOM")}}</div> + +<p><strong><code>NavigatorLanguage.language</code></strong> は、読み取り専用プロパティで、ユーザーの言語を表す文字列を返します。普通、ブラウザー UI の言語が返されます。</p> + +<h2 id="Syntax" name="Syntax">構文</h2> + +<pre class="syntaxbox notranslate">const <em>lang</em> = navigator.language +</pre> + +<h3 id="Value" name="Value">値</h3> + +<p>{{domxref("DOMString")}}。<em><code>lang</code></em> は、<a class="external" href="https://tools.ietf.org/rfc/bcp/bcp47.txt">BCP 47</a> で定義された言語バージョンを表す文字列が格納されます。例えば、"en", "en-US", "fr", "fr-FR", "es-ES" などが含まれます。</p> + +<p>iOS 10.2 以前の Safari では、国コードは小文字で返されます: "en-us", "fr-fr"</p> + +<h2 id="Example" name="Example">例</h2> + +<pre class="brush: js notranslate">if (window.navigator.language.slice(0, 2) !== 'en') { + doLangSelect(window.navigator.language); +} +</pre> + +<h2 id="Specification" name="Specification">仕様</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">仕様</th> + <th scope="col">ステータス</th> + <th scope="col">コメント</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('HTML WHATWG', '#dom-navigator-language', 'NavigatorLanguage: language')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td>初回定義</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザー実装状況</h2> + + + +<p>{{Compat("api.NavigatorLanguage.language")}}</p> + +<h2 id="See_also" name="See_also">関連情報</h2> + +<ul> + <li>{{domxref("NavigatorLanguage.languages", "navigator.languages")}}</li> + <li>{{domxref("navigator")}}</li> +</ul> |