Documentation ¶
Index ¶
- Variables
- type LangKey
- type TranslationRegistry
- func (t *TranslationRegistry) ContainsLanguage(language string) bool
- func (t *TranslationRegistry) CreateVoidTranslator(language string, ressource string) *Translator
- func (t *TranslationRegistry) Languages() []string
- func (t *TranslationRegistry) Matcher() language.Matcher
- func (t *TranslationRegistry) TranslatorFor(language string, ressource string) (*Translator, error)
- type Translator
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLanguageDoesntExist = errors.New("language does not exist")
View Source
var ErrRessourceDoesNotExist = errors.New("ressource does not exist")
Functions ¶
This section is empty.
Types ¶
type TranslationRegistry ¶
type TranslationRegistry struct {
// contains filtered or unexported fields
}
func NewTranslationRegistry ¶
func (*TranslationRegistry) ContainsLanguage ¶
func (t *TranslationRegistry) ContainsLanguage(language string) bool
func (*TranslationRegistry) CreateVoidTranslator ¶
func (t *TranslationRegistry) CreateVoidTranslator(language string, ressource string) *Translator
func (*TranslationRegistry) Languages ¶
func (t *TranslationRegistry) Languages() []string
func (*TranslationRegistry) Matcher ¶
func (t *TranslationRegistry) Matcher() language.Matcher
func (*TranslationRegistry) TranslatorFor ¶
func (t *TranslationRegistry) TranslatorFor( language string, ressource string, ) (*Translator, error)
type Translator ¶
type Translator struct {
// contains filtered or unexported fields
}
func (*Translator) Registry ¶
func (t *Translator) Registry() *TranslationRegistry
Registry retruns the translation registry the Translator was created from
func (*Translator) T ¶
func (t *Translator) T(key ...string) string
T retrives the translation for the supplied key
Click to show internal directories.
Click to hide internal directories.