Versions in this module Expand all Collapse all v0 v0.0.2 Jun 6, 2022 Changes in this version + var ErrUnknowTranslation = errors.New("Unknown Translation") + type ErrBadParamSyntax struct + func (e *ErrBadParamSyntax) Error() string + type ErrBadPluralDefinition struct + func (e *ErrBadPluralDefinition) Error() string + type ErrCardinalTranslation struct + func (e *ErrCardinalTranslation) Error() string + type ErrConflictingTranslation struct + func (e *ErrConflictingTranslation) Error() string + type ErrExistingTranslator struct + func (e *ErrExistingTranslator) Error() string + type ErrMissingBracket struct + func (e *ErrMissingBracket) Error() string + type ErrMissingLocale struct + func (e *ErrMissingLocale) Error() string + type ErrMissingPluralTranslation struct + func (e *ErrMissingPluralTranslation) Error() string + type ErrOrdinalTranslation struct + func (e *ErrOrdinalTranslation) Error() string + type ErrRangeTranslation struct + func (e *ErrRangeTranslation) Error() string + type ImportExportFormat uint8 + const FormatJSON + type Translator interface + Add func(key interface{}, text string, override bool) error + AddCardinal func(key interface{}, text string, rule locales.PluralRule, override bool) error + AddOrdinal func(key interface{}, text string, rule locales.PluralRule, override bool) error + AddRange func(key interface{}, text string, rule locales.PluralRule, override bool) error + C func(key interface{}, num float64, digits uint64, param string) (string, error) + O func(key interface{}, num float64, digits uint64, param string) (string, error) + R func(key interface{}, num1 float64, digits1 uint64, num2 float64, digits2 uint64, ...) (string, error) + T func(key interface{}, params ...string) (string, error) + VerifyTranslations func() error + type UniversalTranslator struct + func New(fallback locales.Translator, supportedLocales ...locales.Translator) *UniversalTranslator + func (t *UniversalTranslator) AddTranslator(translator locales.Translator, override bool) error + func (t *UniversalTranslator) Export(format ImportExportFormat, dirname string) error + func (t *UniversalTranslator) FindTranslator(locales ...string) (trans Translator, found bool) + func (t *UniversalTranslator) GetFallback() Translator + func (t *UniversalTranslator) GetTranslator(locale string) (trans Translator, found bool) + func (t *UniversalTranslator) Import(format ImportExportFormat, dirnameOrFilename string) error + func (t *UniversalTranslator) ImportByReader(format ImportExportFormat, reader io.Reader) error + func (t *UniversalTranslator) VerifyTranslations() (err error)