Documentation ¶
Overview ¶
Package language defines languages that implement CLDR pluralization.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Language ¶
type Language struct { ID string Name string PluralCategories map[plural.Category]struct{} PluralFunc func(*plural.Operands) plural.Category }
Language is a written human language.
Languages are identified by tags defined by RFC 5646.
Typically language tags are a 2 character language code (ISO 639-1) optionally followed by a dash and a 2 character country code (ISO 3166-1). (e.g. en, pt-BR)
A Language implements CLDR plural rules as defined here: http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html http://unicode.org/reports/tr35/tr35-numbers.html#Operands
func LanguageWithID ¶
LanguageWithID returns the language identified by id or nil if the language is not registered.
func (*Language) PluralCategory ¶
PluralCategory returns the plural category for number as defined by the language's CLDR plural rules.