--- 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 ---
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")}}
new Intl.Locale(tag [, options])
tag
options
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.
The Intl.Locale object has the following properties and methods:
Locale
constructor.Specification | Status | Comment |
---|---|---|
Intl.Locale proposal | Stage 3 |
{{Compat("javascript.builtins.Intl.Locale")}}