
Locale models a cultural language and region/country. See docLang::Localization for details.
Slots
- country
-
Str country()
Get the country/region as an uppercase ISO 3166 two letter code. Return null if the country is unspecified.
- current
-
static Locale current()
Get the current thread's locale.
- equals
-
Equality is based on the normalized toStr format.
- fromStr
-
Parse a locale according to the toStr format.
- hash
-
override Int hash()
Compute hash code base on normalized toStr format.
- lang
-
Str lang()
Get the language as a lowercase ISO 639 two letter code.
-
new privateMake()
Private constructor
- prop
-
Resolve a localized property for the specified pod/key pair. The following rules are used for resolution:
- Find the pod and use its resource files
- Lookup via
/locale/{Locale.toStr}.props
- Lookup via
/locale/{Locale.lang}.props
- Lookup via
/locale/en.props
- If all else fails return
pod::key
- setCurrent
-
static Void setCurrent(Locale locale)
Set the current thread's locale. Throw NullErr if null is passed.
- toStr
-
override Str toStr()
Return string representation:
<locale> := <lang> ["-" <country>] <lang> := lowercase ISO 636 two letter code <country> := uppercase ISO 3166 two letter code
- with
-
Run the specified function using this locale as the the thread's current locale. This method guarantees that upon return the thread current's locale remains unchanged.