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.

Packages
ceylon.locale
Dependencies
ceylon.collection1.3.1
ceylon.time1.3.1
Values
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.

Functions
localeSource Codeshared Locale? locale(String tag)

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

Classes
CurrencySource Codeshared 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 Formats

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

LanguageSource Codeshared Language

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

LocaleSource Codeshared Locale

Aggregates localized information associated with a certain locale, including:

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