i18n.getUILanguage()
ブラウザーの UI 言語を取得します。これは、優先されるユーザー言語を返す i18n.getAcceptLanguages
とは異なります。
構文
js
browser.i18n.getUILanguage();
引数
なし。
戻り値
文字列
。i18n.LanguageCode
によるブラウザーの UI 言語コード。
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
getUILanguage |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
例
js
var uiLanguage = browser.i18n.getUILanguage();
console.log(uiLanguage);
//e.g. "ja"
メモ:
この API は、Chromium の chrome.i18n
API を基にしています。このドキュメンテーションは、Chromium コード内の i18n.json
に由来しています。Microsoft Edge 互換性データは、Microsoft Corporation より供給され、Creative Commons Attribution 3.0 United States License の下で含まれています。