const class sys::Locale

sys::Obj
  sys::Locale

@Serializable { simple=true }

Source

Locale models a cultural language and region/country. See Localization for details.

Also see Env.locale and Pod.locale.

country

Str? country()

Source

Get the country/region as an uppercase ISO 3166 two letter code. Return null if the country is unspecified.

cur

static Locale cur()

Source

Get the current thread's locale.

en

const static Locale en

Source

Constant for the English Locale "en"

equals

virtual override Bool equals(Obj? obj)

Source

Equality is based on the normalized toStr format.

fromStr

static new fromStr(Str s, Bool checked := true)

Source

Parse a locale according to the toStr format. If invalid format and checked is false return null, otherwise throw ParseErr.

hash

virtual override Int hash()

Source

Compute hash code based on normalized toStr format.

lang

Str lang()

Source

Get the language as a lowercase ISO 639 two letter code.

setCur

static Void setCur(Locale locale)

Source

Set the current thread's locale. Throw NullErr if null is passed.

toStr

virtual override Str toStr()

Source

Return string representation:

<locale>  := <lang> ["-" <country>]
<lang>    := lowercase ISO 636 two letter code
<country> := uppercase ISO 3166 two letter code
use

This use(|This| func)

Source

Run the specified function using this locale as the actor's current locale. This method guarantees that upon return the actor's current locale remains unchanged.