Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

i18n.getAcceptLanguages()

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!

Gets the accept-languages of the browser. This is different from the locale used by the browser. To get the locale, use i18n.getUILanguage.

Syntax

chrome.i18n.getAcceptLanguages(
  function(languages) {...} // function
)

This API is also available as browser.i18n.getAcceptLanguages() in a version that returns a promise.

Parameters

callback
function. The function is passed the following arguments:
languages
array of i18n.LanguageCode. Array of LanguageCode.

Browser compatibility

Chrome Edge Firefox Firefox for Android Opera
Basic support Yes Yes 47.0 48.0 33

Examples

chrome.i18n.getAcceptLanguages((languages)=> {
  console.log(languages);
});

//e.g. Array [ "en-US", "en" ]

 

Acknowledgements

This API is based on Chromium's chrome.i18n API. This documentation is derived from i18n.json in the Chromium code.

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

ドキュメントのタグと貢献者

 このページの貢献者: Makyen, wbamberg
 最終更新者: Makyen,