--- title: Intl.Locale slug: Web/JavaScript/Reference/Global_Objects/Intl/Locale tags: - Internationalization - Intl - JavaScript - NeedsTranslation - Reference - TopicStub translation_of: Web/JavaScript/Reference/Global_Objects/Intl/Locale ---
{{JSRef}}

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

{{EmbedInteractiveExample("pages/js/intl-locale.html")}}

Syntax

new Intl.Locale(tag [, options])

Parameters

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

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 languagescript, 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.

The Intl.Locale object has the following properties and methods:

Properties

{{jsxref("Locale.prototype", "Intl.Locale.prototype")}}
The prototype object for the Locale constructor.

Specifications

Specification Status Comment
Intl.Locale proposal Stage 3

Browser compatibility

{{Compat("javascript.builtins.Intl.Locale")}}

See also