更新时间:2022-02-03 08:57:31
没有跨浏览器的方法. Internet Explorer支持以下内容:
There is no cross-browser way to do this. Internet Explorer supports the following:
navigator.browserLanguage
:浏览器语言navigator.systemLanguage
:Windows系统语言navigator.userLanguage
:Windows用户特定语言navigator.browserLanguage
: browser languagenavigator.systemLanguage
: Windows system languagenavigator.userLanguage
: Windows user-specific language但是无法从其他任何浏览器访问这些设置(据我所知),所以不要使用它们:坚持使用标准navigator.language
(与浏览器语言相对应)如果要维护跨浏览器功能.如果您确实使用它们,则会将您的网站绑定到特定的操作系统家族(例如Windows)和特定的浏览器(例如Internet Explorer).您真的要这样做吗?
But there is no way to access these settings from any other browsers (that I can tell) so don't use them: stick to the standard navigator.language
(corresponding to the browser language) if you want to maintain cross-browser functionality. If you do use them you will tie your web site to a specific family of operating systems (i.e. Windows) and a specific browser (i.e. Internet Explorer). Do you really want to do this?
为什么浏览器语言不足以支持您的应用?
Why is the browser language insufficient for your application?