Documentation
¶
Overview ¶
Package language exposes the shared language-tag validation to frontends.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base ¶
Base is Canonical without any script or region subtag: the ISO 639-1 primary ("pt" for every spelling of Portuguese). "" when unknown.
func Canonical ¶
Canonical folds any accepted spelling of a language — ISO 639-1 ("pt"), ISO 639-2 ("por"), BCP 47 with any region casing ("pt-BR", "pt_br", "PT-br"), a display name ("Portuguese", "Português") or a parser name ("portuguese-brazil") — to one canonical BCP 47 tag, preserving a known region where the tag carries one: "pt", "por", "Portuguese" and "Português" fold to "pt", while "pt-BR", "pt_br" and "Brazilian Portuguese" keep "pt-BR". The primary subtag is lower-cased and script/region are title-cased ("es-419", "fr-CA", "zh-Hant-TW"). An unknown value returns "".
Types ¶
This section is empty.