Documentation ¶
Overview ¶
Package language defines languages that implement CLDR pluralization.
Index ¶
Constants ¶
View Source
const ( Invalid Plural = "invalid" Zero = "zero" One = "one" Two = "two" Few = "few" Many = "many" Other = "other" )
All defined plural categories.
Variables ¶
This section is empty.
Functions ¶
func NormalizeTag ¶
NormalizeTag returns a language tag with all lower-case characters and dashes "-" instead of underscores "_"
Types ¶
type Language ¶
type Language struct { // Tag uniquely identifies the language as defined by RFC 5646. // // Most language tags are a two character language code (ISO 639-1) // optionally followed by a dash and a two character country code (ISO 3166-1). // (e.g. en, pt-br) Tag string *PluralSpec }
Language is a written human language.
type Plural ¶
type Plural string
Plural represents a language pluralization form as defined here: http://cldr.unicode.org/index/cldr-spec/plural-rules
type PluralSpec ¶
PluralSpec defines the CLDR plural rules for a language. http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html http://unicode.org/reports/tr35/tr35-numbers.html#Operands
func (*PluralSpec) Plural ¶
func (ps *PluralSpec) Plural(number interface{}) (Plural, error)
Plural returns the plural category for number as defined by the language's CLDR plural rules.
Click to show internal directories.
Click to hide internal directories.