Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PluralRule ¶
type PluralRule int
PluralRule denotes the type of plural rules
const ( PluralRuleUnknown PluralRule = iota PluralRuleZero // zero PluralRuleOne // one - singular PluralRuleTwo // two - dual PluralRuleFew // few - paucal PluralRuleMany // many - also used for fractions if they have a separate class PluralRuleOther // other - required—general plural form—also used if the language only has a single form )
PluralRule's
func (PluralRule) String ¶
func (p PluralRule) String() string
String returns the string value of PluralRule
type Translator ¶
type Translator interface { // Locale returns the string value of the translator Locale() string // returns an array of cardinal plural rules associated // with this translator PluralsCardinal() []PluralRule // returns an array of ordinal plural rules associated // with this translator PluralsOrdinal() []PluralRule // returns an array of range plural rules associated // with this translator PluralsRange() []PluralRule // returns the cardinal PluralRule given 'num' and digits/precision of 'v' for locale CardinalPluralRule(num float64, v uint64) PluralRule // returns the ordinal PluralRule given 'num' and digits/precision of 'v' for locale OrdinalPluralRule(num float64, v uint64) PluralRule // returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for locale RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) PluralRule // returns the locales abbreviated month given the 'month' provided MonthAbbreviated(month time.Month) string // returns the locales abbreviated months MonthsAbbreviated() []string // returns the locales narrow month given the 'month' provided MonthNarrow(month time.Month) string // returns the locales narrow months MonthsNarrow() []string // returns the locales wide month given the 'month' provided MonthWide(month time.Month) string // returns the locales wide months MonthsWide() []string // returns the locales abbreviated weekday given the 'weekday' provided WeekdayAbbreviated(weekday time.Weekday) string // returns the locales abbreviated weekdays WeekdaysAbbreviated() []string // returns the locales narrow weekday given the 'weekday' provided WeekdayNarrow(weekday time.Weekday) string // WeekdaysNarrowreturns the locales narrow weekdays WeekdaysNarrow() []string // returns the locales short weekday given the 'weekday' provided WeekdayShort(weekday time.Weekday) string // returns the locales short weekdays WeekdaysShort() []string // returns the locales wide weekday given the 'weekday' provided WeekdayWide(weekday time.Weekday) string // returns the locales wide weekdays WeekdaysWide() []string // returns 'num' with digits/precision of 'v' for locale and handles both Whole and Real numbers based on 'v' FmtNumber(num float64, v uint64) string // returns 'num' with digits/precision of 'v' for locale and handles both Whole and Real numbers based on 'v' // NOTE: 'num' passed into FmtPercent is assumed to be in percent already FmtPercent(num float64, v uint64) string // returns the currency representation of 'num' with digits/precision of 'v' for locale FmtCurrency(num float64, v uint64, currency currency.Type) string // returns the currency representation of 'num' with digits/precision of 'v' for locale // in accounting notation. FmtAccounting(num float64, v uint64, currency currency.Type) string // returns the short date representation of 't' for '{{ .Locale }}' FmtDateShort(t time.Time) string // returns the medium date representation of 't' for '{{ .Locale }}' FmtDateMedium(t time.Time) string // returns the long date representation of 't' for '{{ .Locale }}' FmtDateLong(t time.Time) string // returns the full date representation of 't' for '{{ .Locale }}' FmtDateFull(t time.Time) string // returns the short time representation of 't' for '{{ .Locale }}' FmtTimeShort(t time.Time) string // returns the medium time representation of 't' for '{{ .Locale }}' FmtTimeMedium(t time.Time) string // returns the long time representation of 't' for '{{ .Locale }}' FmtTimeLong(t time.Time) string // returns the full time representation of 't' for '{{ .Locale }}' FmtTimeFull(t time.Time) string }
Translator encapsulates an instance of a locale NOTE: some values are returned as a []byte just in case the caller wishes to add more and can help avoid allocations; otherwise just cast as string
Click to show internal directories.
Click to hide internal directories.