Intl.Locale() constructor

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


new Intl.Locale(tag [, options])


The Unicode locale identifier string.
An object that contains configuration for the Locale. Keys are Unicode locale tags, values are valid Unicode tag values.


Basic usage

At its very simplest, the Intl.Locale constructor takes a locale identifier string as its argument:

let us = new Intl.Locale('en-US');

Using the Locale constructor with an options object

The constructor also takes an optional configuration object argument, which can contain any of several extension types. For example, set the hourCycle property of the configuration object to your desired hour cycle type, and then pass it into the constructor:

let us12hour = new Intl.Locale("en-US", {hourCycle: "h12"});
console.log(us12hour.hourCycle); // Prints "h12"


ECMAScript Internationalization API (ECMA-402)

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
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


Full support  
Full support
No support  
No support

See also