Versions in this module Expand all Collapse all v0 v0.1.0 Jun 17, 2020 Changes in this version + func Handler(ts *Translators, next http.Handler, parsers ...LanguageParser) http.Handler + func Middleware(ts *Translators, parsers ...LanguageParser) func(http.Handler) http.Handler + type CookieLanguageParser struct + func NewCookieLanguageParser(name string) CookieLanguageParser + func (p CookieLanguageParser) Parse(r *http.Request) string + type FileDecoder interface + Decode func([]byte, *Translation) error + type FileStore struct + Decoder FileDecoder + Directory string + func NewFileStore(directory string, decoder FileDecoder) *FileStore + func (s *FileStore) Get() (Translations, error) + type HeaderLanguageParser struct + func (HeaderLanguageParser) Parse(r *http.Request) string + type JSONFileDecoder struct + func (d JSONFileDecoder) Decode(data []byte, translation *Translation) error + type LanguageParser interface + Parse func(*http.Request) string + type Option func(ts *Translators) + func Fallback(fallback string) Option + type Store interface + Get func() (Translations, error) + type Translation map[string]string + type Translations map[string]Translation + type Translator struct + func GetTranslator(r *http.Request) *Translator + func NewTranslator(printer *message.Printer) *Translator + type Translators struct + func New(opts ...Option) *Translators + func (ts *Translators) Import(store Store) error + func (ts *Translators) MatchTranslator(langs ...string) *Translator + type URLLanguageParser struct + func NewURLLanguageParser(name string) URLLanguageParser + func (p URLLanguageParser) Parse(r *http.Request) string