Versions in this module Expand all Collapse all v0 v0.14.2 May 26, 2024 v0.14.1 Jan 31, 2024 v0.14.0 Jan 30, 2024 Changes in this version + const CLDRVersion + const NumLanguages + const NumRegions + const NumScripts + var AliasMap = [193]FromTo + var AliasTypes = [193]AliasType + var ErrDuplicateKey = errors.New("language: different values for same key in -u extension") + var ErrMissingLikelyTagsData = errors.New("missing likely tags data") + var ErrSyntax = errors.New("language: tag is not well-formed") + func ParseExtension(s string) (ext string, err error) + type AliasType int8 + const AliasTypeUnknown + const Deprecated + const Legacy + const Macro + type Builder struct + Tag Tag + func (b *Builder) AddExt(e string) + func (b *Builder) AddVariant(v ...string) + func (b *Builder) ClearExtensions() + func (b *Builder) ClearVariants() + func (b *Builder) Make() Tag + func (b *Builder) SetExt(e string) + func (b *Builder) SetTag(t Tag) + type CompactCoreInfo uint32 + func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) + func (c CompactCoreInfo) Tag() Tag + type FromTo struct + From uint16 + To uint16 + type Language uint16 + func BaseLanguages() []Language + func MustParseBase(s string) Language + func ParseBase(s string) (l Language, err error) + func (b Language) ISO3() string + func (b Language) IsPrivateUse() bool + func (b Language) String() string + func (b Language) SuppressScript() Script + func (id Language) Canonicalize() (Language, AliasType) + func (id Language) StringToBuf(b []byte) int + type Region uint16 + func EncodeM49(r int) (Region, error) + func MustParseRegion(s string) Region + func ParseRegion(s string) (r Region, err error) + func (r Region) Canonicalize() Region + func (r Region) Contains(c Region) bool + func (r Region) ISO3() string + func (r Region) IsCountry() bool + func (r Region) IsGroup() bool + func (r Region) IsPrivateUse() bool + func (r Region) M49() int + func (r Region) String() string + func (r Region) TLD() (Region, error) + type Script uint16 + func MustParseScript(s string) Script + func ParseScript(s string) (scr Script, err error) + func (s Script) IsPrivateUse() bool + func (s Script) String() string + type Tag struct + LangID Language + RegionID Region + ScriptID Script + var Und Tag + func Make(s string) Tag + func MustParse(s string) Tag + func Parse(s string) (t Tag, err error) + func (t *Tag) RemakeString() + func (t *Tag) UnmarshalText(text []byte) error + func (t Tag) Extension(x byte) (ext string, ok bool) + func (t Tag) Extensions() []string + func (t Tag) HasExtensions() bool + func (t Tag) HasString() bool + func (t Tag) HasVariants() bool + func (t Tag) IsPrivateUse() bool + func (t Tag) IsRoot() bool + func (t Tag) MarshalText() (text []byte, err error) + func (t Tag) Maximize() (Tag, error) + func (t Tag) Parent() Tag + func (t Tag) Raw() (b Language, s Script, r Region) + func (t Tag) SetTypeForKey(key, value string) (Tag, error) + func (t Tag) String() string + func (t Tag) TypeForKey(key string) string + func (t Tag) VariantOrPrivateUseTags() string + func (t Tag) Variants() string + type ValueError struct + func NewValueError(tag []byte) ValueError + func (e ValueError) Error() string + func (e ValueError) Subtag() string + type Variant struct + ID uint8 + func ParseVariant(s string) (v Variant, err error) + func (v Variant) String() string