coderef

Intl.LocaleBaseline · Widely available

The Intl.Locale API parses Unicode locale identifiers, with language, region, and script codes, such as zh-Hans-CN or en-GB.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 16, 2020. Widely available since Mar 16, 2023.

Browser support

DesktopChrome
1–73Not supported
74+Supportedsince Apr 23, 2019
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–74Not supported
75+Supportedsince Apr 7, 2020
Current: 157
Safari
1–13.1Not supported
14+Supportedsince Sep 16, 2020
Current: 27
MobileChrome Android
18–73Not supported
74+Supportedsince Apr 24, 2019
Current: 155
Firefox Android
4–68Not supported
79+Supportedsince Jul 28, 2020
Current: 157
Safari iOS
1–13.4Not supported
14+Supportedsince Sep 16, 2020
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: Locale.

Feature detection

JS · check before using
if ("Locale" in Intl || ("prototype" in Intl && "Locale" in Intl.prototype)) {
  // Intl.Locale is available
}

Sub-features

Support for each part of the feature (15). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Intl.Locale74797514747914
Intl.Locale.Locale74797514747914
Intl.Locale.baseName74797514747914
Intl.Locale.calendar74797514747914
Intl.Locale.caseFirst74797514747914
Intl.Locale.collation74797514747914
Intl.Locale.hourCycle74797514747914
Intl.Locale.language74797514747914
Intl.Locale.maximize74797514747914
Intl.Locale.minimize74797514747914
Intl.Locale.numberingSystem74797514747914
Intl.Locale.numeric74797514747914
Intl.Locale.region74797514747914
Intl.Locale.script74797514747914
Intl.Locale.toString74797514747914