Source Code

Provides information about locale-specific information including:

  • language,
  • currency,
  • numeric formats, and
  • data/time formats.

A locale is identified by a locale tag, as specified by IETF BCP 47, which contains:

  • a required language code, for example en, es, or ca,
  • an optional script code, for example, Latn, or Cyrl,
  • an optional country or region code, for example, AU, MX, or ES, and
  • optionally, one or more variant values, and
  • optionally, one or more extensions as name/value pairs.

Fields are separated by the character -. For example: en, ca, en-AU, es-MX.

A Locale instance may be obtained for a given tag, by calling locale():

assert (exists au = locale("en-AU"));

The system locale is also available.

The Locale object provides information about the Language, Currency and Formats of the locale it represents, along with information about the names of other languages and currencies in that locale.

dayMonthYearSource Codeshared Order dayMonthYear

The day/month/year Order.

monthDayYearSource Codeshared Order monthDayYear

The month/day/year Order.

systemLocaleSource Codeshared Locale systemLocale

Returns a Locale containing information about the locale of the current system.

See also system.locale
yearMonthDaySource Codeshared Order yearMonthDay

The year/month/day Order.

localeSource Codeshared Locale? locale(String tag)

Returns a Locale containing information about the locale with the given locale tag.

CurrencySource Codeshared sealed Currency

Localized information about the currency with the given ISO 4217 currency Currency.code.

DateFieldSource Codeshared DateField

Enumerates the fields of a formatted Date.

FormatsSource Codeshared sealed Formats

Date, time, currency, and numeric formats for a certain Locale.

LanguageSource Codeshared sealed Language

Localized information about the language associated with the given locale Language.tag.

LocaleSource Codeshared sealed Locale

Aggregates localized information associated with a certain locale, including:

The locale also provides access to associated localized message bundles via Locale.messages().