This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

userLanguage

Summary

Retrieves the operating system’s natural language setting.

This property reflects the setting in the "Your locale (location)" box in the Regional Options of Control Panel—for example, "English (United States).

Property of dom/Navigatordom/Navigator

Syntax

Note: This property is read-only.

var result = navigator.userLanguage;

Return Value

Returns an object of type StringString

see Language Codes for a full listing of possible values.

Examples

This example enumerates the properties and methods of your web browsers ‘navigator’ object and displays the results on the screen.

the navigator.userLanguage may or may not be supported by your web browser.


View live example

Usage

 Do not use as this property reflects the language preferences of the users' Operating system NOT their language preferences for web content.

Notes

Remarks

This property reflects the setting in the "Your locale (location)" box in the Regional Options of Control Panel—for example, "English (United States).

Syntax

var result=navigator.userLanguage;

Attributions