Aggregates localized information associated with a certain locale, including:

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

no subtypes hierarchy

Initializer
Locale(Language language, Formats formats, Map<String,Language> languages, Map<String,Currency> currencies, String? currencyCode = null, Map<Character,String> lowercaseMappings = ..., Map<Character,String> uppercaseMappings = ...)
Parameters:
  • language

    The language of this locale.

  • formats

    Localized date, time, currency, and numeric formats for this locale.

  • languages

    Localized representations of other languages.

  • currencies

    Localized representations of other currencies.

  • currencyCode = null
  • lowercaseMappings = emptyMap

    Localized mappings of uppercase characters to lowercase.

  • uppercaseMappings = emptyMap

    Localized mappings of lowercase characters to uppercase.

Attributes
currenciesSource Codeshared Map<String,Currency> currencies

Localized representations of other currencies.

currencySource Codeshared Currency? currency

The currency of this locale.

formatsSource Codeshared Formats formats

Localized date, time, currency, and numeric formats for this locale.

languageSource Codeshared Language language

The language of this locale.

languagesSource Codeshared Map<String,Language> languages

Localized representations of other languages.

stringSource Codeshared actual String string

A developer-friendly string representing the instance. Concatenates the name of the concrete class of the instance with the hash of the instance. Subclasses are encouraged to refine this implementation to produce a more meaningful representation.

Inherited Attributes
Attributes inherited from: Object
Methods
lowercaseSource Codeshared String lowercase(String string)

A string with the characters of the given string converted to lowercase according to the rules of this locale.

messagesSource Codeshared Map<String,String> messages(Module|Package component, String name = ...)

Given a Module or Package and the name of a resource bundle belonging to that package or module, return a map of string keys to string values for this locale.

For example, suppose the system locale is en-AU, and this code occurs in the module hello.world:

value messages = systemLocale.messages(`module`, "Errors");

Then the returned map messages will contain entries from a properties file in the resources of the module hello.world. The following files will be searched, in order:

  1. /hello/world/Errors_en_AU.properties
  2. /hello/world/Errors_en.properties
  3. /hello/world/Errors.properties

If no properties file is found, the map with be empty.

Parameters:
  • component

    The module to which the resource bundle belongs.

  • name = "Messages"

    The name of the resource bundle, or "Messages" by default.

uppercaseSource Codeshared String uppercase(String string)

A string with the characters of the given string converted to uppercase according to the rules of this locale.

Inherited Methods
Methods inherited from: Object