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 compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes ? Yes Yes Yes Yes
Support on WorkerNavigator ? ?35 No ? No
language Yes1 Yes

12

53

114 Yes Yes
languages325 Yes3261172411
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes ? Yes Yes Yes ?
Support on WorkerNavigator ? ? ?35 ? No ?
language Yes1 Yes1 Yes4 Yes Yes ?
languages325325 Yes4624 Yes ?

1. Returns the browser UI language, not the value of the Accept-Language HTTP header.

2. Prior to Firefox 4 this property's value was also part of the user agent string, as reported by navigator.userAgent.

3. Starting in Firefox 5.0 this property's value is based on the value of the Accept-Language HTTP header.

4. Closest available (non-standard) properties are userLanguage and browserLanguage.

5. In Chrome, navigator.language is the language of the browser UI, and is not guaranteed to be equal to navigator.languages[0].

6. In Firefox, the navigator.languages property's value is taken from the intl.accept_languages preference.

7. Closest available (non-standard) properties are userLanguage and browserLanguage.

See also

  • The Navigator interface that implements it.

Document Tags and Contributors

Contributors to this page: fscholz, teoli, realityking
Last updated by: fscholz,