glintl/locales
Pick a locale from a tag such as "en-GB", for example from an
Accept-Language header or the browser’s language.
This module refers to every locale. If you know which you need, import
them from glintl/locale/ instead.
Generated by codegen/generate.ts. Do not edit.
Values
pub fn all() -> List(glintl.Locale)
pub fn from_tag(tag: String) -> Result(glintl.Locale, Nil)
Find a locale by its BCP 47 tag. Case and _ or - don’t matter.
If there is no exact match, the last part of the tag is dropped and it
tries again, so "fr-CA-x-mine" gives Canadian French and "en-XX"
gives English.
from_tag("en_GB") // -> Ok(en_gb.locale())
from_tag("zh-TW") // -> Ok(zh_hant.locale())
from_tag("xx") // -> Error(Nil)