W3cubDocs

/DOM

navigatorLanguage

NavigatorLanguage contains methods and properties related to the language of the navigator.

There is no object of type NavigatorLanguage, but other interfaces, like Navigator or WorkerNavigator, implement it.

Properties

The NavigatorLanguage interface doesn't inherit any property.

NavigatorLanguage.language Read only
Returns a DOMString representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown.
NavigatorLanguage.languages Read only
Returns an array of DOMString representing the languages known to the user, by order of preference.

Methods

The NavigatorLanguage interface neither implements, nor inherit any method.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'NavigatorLanguage' in that specification.
Living Standard Since the HTML5 snapshot, the languages property has been added.
HTML5
The definition of 'NavigatorLanguage' in that specification.
Recommendation Initial specification; snapshot of an early versionHTML Living Standard.

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support Yes ? Yes Yes Yes Yes
Support on WorkerNavigator ? ? 35 No ? No
language Yes
Yes
Returns the browser UI language, not the value of the Accept-Language HTTP header.
Yes 1
1
Prior to Firefox 4 this property's value was also part of the user agent string, as reported by navigator.userAgent.
5
Starting in Firefox 5.0 this property's value is based on the value of the Accept-Language HTTP header.
11
11
Closest available (non-standard) properties are userLanguage and browserLanguage.
Yes Yes
languages 32
32
In Chrome, navigator.language is the language of the browser UI, and is not guaranteed to be equal to navigator.languages[0].
Yes 32
32
In Firefox, the navigator.languages property's value is taken from the intl.accept_languages preference.
11
11
Closest available (non-standard) properties are userLanguage and browserLanguage.
24 11
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support Yes Yes ? Yes Yes Yes ?
Support on WorkerNavigator ? ? ? 35 ? No ?
language Yes
Yes
Returns the browser UI language, not the value of the Accept-Language HTTP header.
Yes
Yes
Returns the browser UI language, not the value of the Accept-Language HTTP header.
Yes 4 Yes Yes ?
languages 4.4.3
4.4.3
In Chrome, navigator.language is the language of the browser UI, and is not guaranteed to be equal to navigator.languages[0].
32
32
In Chrome, navigator.language is the language of the browser UI, and is not guaranteed to be equal to navigator.languages[0].
Yes 4
4
In Firefox, the navigator.languages property's value is taken from the intl.accept_languages preference.
24 Yes ?

See also

  • The Navigator interface that implements it.

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/navigatorLanguage