这篇翻译不完整。请帮忙从英语翻译这篇文章

这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

只读属性 NavigatorLanguage.languages 返回一个 DOMString 的数组,数组内容表示网站访客所使用的语言。 使用 BCP 47 语言标签来描述不同的语言。 在返回的数组中,最适合当前用户的语言将会被排到数组的首位。

navigator.language 的值是该属性返回数组的第一个元素 [3]。(但它基于系统语言设置。)

当该值发生改变,即最适合用户的语言被改变, 事件languagechange 将会在 Window 对象下触发。

在每一个HTTP请求上的来自用户浏览器的HTTP协议头 Accept-Language 使用相同的来自 navigator.languages 属性的语言值,除了特殊的 qvalues (权重值) 字段 (如:en-US;q=0.8)。

语法

preferredLanguages = globalObj.navigator.languages

例子

navigator.language   //"en-US"
navigator.languages  //["en-US", "zh-CN", "ja-JP"]

标准

标准 状态 备注
HTML 5.1
NavigatorLanguage.languages
Recommendation

初始化定义

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
languages
Experimental
Chrome Full support 32
Notes
Full support 32
Notes
Notes In Chrome, navigator.language is the language of the browser UI, and is not guaranteed to be equal to navigator.languages[0].
Edge Full support YesFirefox Full support 32
Notes
Full support 32
Notes
Notes In Firefox, the navigator.languages property's value is taken from the intl.accept_languages preference.
IE Full support 11
Notes
Full support 11
Notes
Notes Closest available (non-standard) properties are userLanguage and browserLanguage.
Opera Full support 24Safari Full support 11WebView Android Full support 4.4.3
Notes
Full support 4.4.3
Notes
Notes In Chrome, navigator.language is the language of the browser UI, and is not guaranteed to be equal to navigator.languages[0].
Chrome Android Full support 32
Notes
Full support 32
Notes
Notes In Chrome, navigator.language is the language of the browser UI, and is not guaranteed to be equal to navigator.languages[0].
Edge Mobile Full support YesFirefox Android Full support 4
Notes
Full support 4
Notes
Notes In Firefox, the navigator.languages property's value is taken from the intl.accept_languages preference.
Opera Android Full support 24Safari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
See implementation notes.
See implementation notes.

参见

文档标签和贡献者

标签: 
此页面的贡献者: mdnwebdocs-bot, fscholz, micblo
最后编辑者: mdnwebdocs-bot,