Class Locale

Represents a Locale supported by the system.

PropertyDescription
ID: String (read-only)Returns the String representation of the localeID.
ISO3Country: String (read-only)Returns the uppercase ISO 3166 3-letter country/region code for this Locale.
ISO3Language: String (read-only)Returns the 3-letter ISO 639 language code for this Locale.
country: String (read-only)Returns the uppercase ISO 3166 2-letter country/region code for this Locale.
displayCountry: String (read-only)Returns the display name of this Locale's country, in this Locale's language, not in the session locale's language.
displayLanguage: String (read-only)Returns the display name of this Locale's language, in this Locale's language, not in the session locale's language.
displayName: String (read-only)Returns the display name of this Locale, in this Locale's language, not in the session locale's language.
language: String (read-only)Returns the lowercase ISO 639 language code for this Locale.

This class does not have a constructor, so you cannot create it directly.

MethodDescription
getCountry()Returns the uppercase ISO 3166 2-letter country/region code for this Locale.
getDisplayCountry()Returns the display name of this Locale's country, in this Locale's language, not in the session locale's language.
getDisplayLanguage()Returns the display name of this Locale's language, in this Locale's language, not in the session locale's language.
getDisplayName()Returns the display name of this Locale, in this Locale's language, not in the session locale's language.
getID()Returns the String representation of the localeID.
getISO3Country()Returns the uppercase ISO 3166 3-letter country/region code for this Locale.
getISO3Language()Returns the 3-letter ISO 639 language code for this Locale.
getLanguage()Returns the lowercase ISO 639 language code for this Locale.
static getLocale(String)Returns a Locale instance for the given localeId, or null if no such Locale could be found.
toString()Returns the String representation of the localeID.

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

ID: String (read-only)

Returns the String representation of the localeID.

Combines the language and the country key, concatenated with "_". For example: "en_US". This attribute is the primary key of the class.


ISO3Country: String (read-only)

Returns the uppercase ISO 3166 3-letter country/region code for this Locale. If no country has been specified for this Locale, this value is an empty string.


ISO3Language: String (read-only)

Returns the 3-letter ISO 639 language code for this Locale. If no language has been specified for this Locale, this value is an empty string.


country: String (read-only)

Returns the uppercase ISO 3166 2-letter country/region code for this Locale. If no country has been specified for this Locale, this value is an empty string.


displayCountry: String (read-only)

Returns the display name of this Locale's country, in this Locale's language, not in the session locale's language. If no country has been specified for this Locale, this value is an empty string.


displayLanguage: String (read-only)

Returns the display name of this Locale's language, in this Locale's language, not in the session locale's language. If no country has been specified for this Locale, this value is an empty string.


displayName: String (read-only)

Returns the display name of this Locale, in this Locale's language, not in the session locale's language. If no display name has been specified for this Locale, this value is an empty string.


language: String (read-only)

Returns the lowercase ISO 639 language code for this Locale. If no language has been specified for this Locale, this value is an empty string.


getCountry(): String

Returns the uppercase ISO 3166 2-letter country/region code for this Locale. If no country has been specified for this Locale, this value is an empty string.

Returns:

  • the uppercase ISO 3166 2-letter country/region code for this Locale. If no country has been specified for this Locale, this value is an empty string.

getDisplayCountry(): String

Returns the display name of this Locale's country, in this Locale's language, not in the session locale's language. If no country has been specified for this Locale, this value is an empty string.

Returns:

  • the display name of this Locale's country, in this Locale's language. If no country has been specified for this Locale, this value is an empty string.

getDisplayLanguage(): String

Returns the display name of this Locale's language, in this Locale's language, not in the session locale's language. If no country has been specified for this Locale, this value is an empty string.

Returns:

  • the display name of this Locale's language, in this Locale's language. If no language has been specified for this Locale, this value is an empty string.

getDisplayName(): String

Returns the display name of this Locale, in this Locale's language, not in the session locale's language. If no display name has been specified for this Locale, this value is an empty string.

Returns:

  • the display name of this Locale, in this Locale's language. If no display name has been specified for this Locale, this value is an empty string.

getID(): String

Returns the String representation of the localeID.

Combines the language and the country key, concatenated with "_". For example: "en_US". This attribute is the primary key of the class.

Returns:

  • the String representation of the localeID.

getISO3Country(): String

Returns the uppercase ISO 3166 3-letter country/region code for this Locale. If no country has been specified for this Locale, this value is an empty string.

Returns:

  • the uppercase ISO 3166 3-letter country/region code for this Locale. If no country has been specified for this Locale, this value is an empty string.

getISO3Language(): String

Returns the 3-letter ISO 639 language code for this Locale. If no language has been specified for this Locale, this value is an empty string.

Returns:

  • the 3-letter ISO 639 language code for this Locale. If no language has been specified for this Locale, this value is an empty string.

getLanguage(): String

Returns the lowercase ISO 639 language code for this Locale. If no language has been specified for this Locale, this value is an empty string.

Returns:

  • the lowercase ISO 639 language code for this Locale. If no language has been specified for this Locale, this value is an empty string.

static getLocale(localeId: String): Locale

Returns a Locale instance for the given localeId, or null if no such Locale could be found.

Parameters:

  • localeId - the localeID of the desired Locale

Returns:

  • the Locale instance for the given localeId, or null if no such Locale could be found.

toString(): String

Returns the String representation of the localeID.

Combines the language and the country key, concatenated with "_". For example: "en_US". This attribute is the primary key of the class.

Returns:

  • the String representation of the localeID.