Intl

getCanonicalLocalesExn

RESCRIPT
let getCanonicalLocalesExn: string => array<string>

getCanonicalLocalesExn(locale) returns the canonical form of locale.

Throws RangeError when the locale string is malformed.

See Intl.getCanonicalLocales on MDN.

Examples

RESCRIPT
Intl.getCanonicalLocalesExn("EN-US") == ["en-US"]

getCanonicalLocalesManyExn

RESCRIPT
let getCanonicalLocalesManyExn: array<string> => array<string>

getCanonicalLocalesManyExn(locales) canonicalises every locale in locales.

Throws RangeError when any locale string is malformed.

See Intl.getCanonicalLocales on MDN.

Examples

RESCRIPT
Intl.getCanonicalLocalesManyExn(["EN-US", "fr"]) == ["en-US", "fr"]

supportedValuesOfExn

RESCRIPT
let supportedValuesOfExn: string => array<string>

supportedValuesOfExn(key) returns the list of values supported by the runtime for the feature identified by key.

Throws RangeError when key is unsupported.

See Intl.supportedValuesOf on MDN.

Examples

RESCRIPT
Intl.supportedValuesOfExn("calendar")->Array.includes("gregory") == true