# Global.Intl

Namespace providing JavaScript's standard internationalization APIs.

Availability
9.1.0
6.0.0
9.2.0
Extends
Object

# Overview

Provides support for localized number formatting, date/time formatting, and language sensitive string comparisons.

For more detail, see the MDN website about Intl (opens new window).

# Methods

# getCanonicalLocales

Availability
9.1.0
6.0.0
9.2.0
getCanonicalLocales([locales]) Array<String>

Gets canonical locale identifiers matching given BCP 47 locale identifiers.

// Will return ['en-US'].
Ti.API.info(Intl.getCanonicalLocales('EN-US'));

// Will return ['en-US', 'fr'].
Ti.API.info(Intl.getCanonicalLocales(['EN-US', 'Fr']));

Parameters

Name Type Description
locales String | Array<String>

A string or array of strings providing BCP 47 locale identifiers to fetch the canoncial names of.

Returns

Returns an array of canonical names matching given BCP 47 locale names. Duplicate locales will be removed. Returns an empty array if argument is empty or undefined.

Type
Array<String>