--- title: NavigatorLanguage slug: Web/API/NavigatorLanguage tags: - API - HTML-DOM - Reference translation_of: Web/API/NavigatorLanguage ---

{{APIRef("HTML DOM")}}

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

There is no object of type NavigatorLanguage, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

Properties

The NavigatorLanguage interface doesn't inherit any property.

{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
Returns a {{domxref("DOMString")}} representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown.
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
Returns an array of {{domxref("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
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}} {{Spec2('HTML WHATWG')}} Since the {{SpecName('HTML5 W3C')}} snapshot, the languages property has been added.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}} {{Spec2('HTML5 W3C')}} Initial specification; snapshot of  an early version{{SpecName('HTML WHATWG')}}.

Browser compatibility

{{Compat("api.NavigatorLanguage")}}

See also