Intl.Locale

The Intl.Locale object is a standard built-in property of the Intl object that represents a Unicode locale identifier.

Description

The Intl.Locale object was created to allow for easier manipulation of Unicode locales. Unicode represents locales with a string, called a locale identifier. The locale identifier consists of a language identifier and extension tags. Language identifiers are the core of the locale, consisting of language, script, and region subtags. Additional information about the locale is stored in the optional extension tags. Extension tags hold information about locale aspects such as calendar type, clock type, and numbering system type.

Traditionally, the Intl API used strings to represent locales, just as Unicode does. This is a simple and lightweight solution that works well. Adding a Locale class, however, adds ease of parsing and manipulating the language, script, and region, as well as extension tags.

Constructor

Intl.Locale()
Creates a new Locale object.

Properties

Intl.Locale.prototype
The prototype object for the Locale constructor.

Instance properties

Intl.Locale.prototype.baseName
Returns basic, core information about the Locale in the form of a substring of the complete data string.
Intl.Locale.prototype.calendar
Returns the part of the Locale that indicates the Locale's calendar era.
Intl.Locale.prototype.caseFirst
Returns whether case is taken into account for the locale's collation rules.
Intl.Locale.prototype.collation
Returns the collation type for the Locale, which is used to order strings according to the locale's rules.
Intl.Locale.prototype.hourCycle
Returns the time keeping format convention used by the locale.
Intl.Locale.prototype.language
Returns the language associated with the locale.
Intl.Locale.prototype.numberingSystem
Returns the numeral system used by the locale.
Intl.Locale.prototype.numeric
Returns whether the locale has special collation handling for numeric characters.
Intl.Locale.prototype.region
Returns the region of the world (usually a country) associated with the locale.
Intl.Locale.prototype.script
Returns the script used for writing the particular language used in the locale.

Instance methods

Intl.Locale.prototype.minimize()
Gets the most likely values for the language, script, and region of the locale based on existing values.
Intl.Locale.prototype.maximize()
Gets the most likely values for the language, script, and region of the locale based on existing values.
Intl.Locale.prototype.toString()
Returns the Locale's full locale identifier string.

Specifications

Specification
ECMAScript Internationalization API (ECMA-402)

Browser compatibility

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
LocaleChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
Locale() constructorChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
baseNameChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
calendarChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
caseFirstChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
collationChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
hourCycleChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
languageChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
maximizeChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
minimizeChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
numberingSystemChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
numericChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
regionChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
scriptChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No
toStringChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs No support No

Legend

Full support  
Full support
No support  
No support

See also