# Packages
Package compact defines a compact representation of language tags.
# Functions
BaseLanguages returns the list of all supported base languages.
EncodeM49 returns the Region for the given UN M.49 code.
GetCompactCore generates a uint32 value that is guaranteed to be unique for different language, region, and script values.
Make is a convenience wrapper for Parse that omits the error.
MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed.
MustParseBase is like ParseBase, but panics if the given base cannot be parsed.
MustParseRegion is like ParseRegion, but panics if the given region cannot be parsed.
MustParseScript is like ParseScript, but panics if the given script cannot be parsed.
NewValueError creates a new ValueError.
Parse parses the given BCP 47 string and returns a valid Tag.
ParseBase parses a 2- or 3-letter ISO 639 code.
ParseExtension parses s as an extension and returns it on success.
ParseRegion parses a 2- or 3-letter ISO 3166-1 or a UN M.49 code.
ParseScript parses a 4-letter ISO 15924 code.
ParseVariant parses and returns a Variant.
# Constants
No description provided by the author
CLDRVersion is the CLDR version from which the tables in this package are derived.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
AliasMap maps langIDs to their suggested replacements.
Size: 193 bytes, 193 elements.
ErrDuplicateKey is returned when a tag contains the same key twice with different values in the -u section.
ErrMissingLikelyTagsData indicates no information was available to compute likely values of missing tags.
ErrSyntax is returned by any of the parsing functions when the input is not well-formed, according to BCP 47.
Und is the root language.
# Structs
A Builder allows constructing a Tag from individual components.
No description provided by the author
Tag represents a BCP 47 language tag.
ValueError is returned by any of the parsing functions when the input is well-formed but the respective subtag is not recognized as a valid value.
Variant represents a registered variant of a language as defined by BCP 47.
# Type aliases
AliasType is the type of an alias in AliasMap.
CompactCoreInfo is a compact integer with the three core tags encoded.
No description provided by the author
No description provided by the author
No description provided by the author