Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseAcceptLanguage ¶
ParseAcceptLanguage Sample Accept-Language: ru;q=0.9, fr-CH, fr;q=0.8, en;q=0.7, *;q=0.5
Types ¶
type ErrorMessage ¶
func (*ErrorMessage) DetailsToString ¶
func (em *ErrorMessage) DetailsToString() string
type Locale ¶
type Locale struct {
// contains filtered or unexported fields
}
func DefaultLocale ¶ added in v0.1.1
func DefaultLocale() *Locale
func (*Locale) TranslateError ¶
func (l *Locale) TranslateError(id, defaultMessage string, args ...mrmsg.NamedArg) ErrorMessage
type Translator ¶
type Translator struct {
// contains filtered or unexported fields
}
func NewTranslator ¶
func NewTranslator(opt TranslatorOptions) (*Translator, error)
func (*Translator) DefaultLocale ¶ added in v0.3.0
func (t *Translator) DefaultLocale() *Locale
func (*Translator) FindFirstLocale ¶ added in v0.1.1
func (t *Translator) FindFirstLocale(langs ...string) *Locale
func (*Translator) RegisteredLocales ¶
func (t *Translator) RegisteredLocales() []*Locale
Click to show internal directories.
Click to hide internal directories.