Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type I18n ¶
type I18n interface { Get(namespace string, lang LanguageCodes, key, def string) string Text(namespace string, lang LanguageCodes, key string) string Sprintf(namespace string, lang LanguageCodes, key string, args ...interface{}) string Translator(namespace string) Translator RegisterFilesFromFS(fsPrefix string, rootFS embed.FS) error }
I18n .
type Internationalizable ¶
type Internationalizable interface {
Translate(t Translator, langs LanguageCodes) string
}
Internationalizable .
type LanguageCode ¶
LanguageCode .
func (*LanguageCode) ElaboratedCode ¶
func (lc *LanguageCode) ElaboratedCode() string
ElaboratedCode .
func (*LanguageCode) RestrictedCode ¶
func (lc *LanguageCode) RestrictedCode() string
RestrictedCode .
type LanguageCodes ¶
type LanguageCodes []*LanguageCode
LanguageCodes .
func ParseLanguageCode ¶
func ParseLanguageCode(text string) (list LanguageCodes, err error)
ParseLanguageCode .
type NopTranslator ¶
type NopTranslator struct{}
NopTranslator .
func (*NopTranslator) Get ¶
func (t *NopTranslator) Get(lang LanguageCodes, key, def string) string
Get .
func (*NopTranslator) Sprintf ¶
func (t *NopTranslator) Sprintf(lang LanguageCodes, key string, args ...interface{}) string
Sprintf .
func (*NopTranslator) Text ¶
func (t *NopTranslator) Text(lang LanguageCodes, key string) string
Text .
type Translator ¶
type Translator interface { Get(lang LanguageCodes, key, def string) string Text(lang LanguageCodes, key string) string Sprintf(lang LanguageCodes, key string, args ...interface{}) string }
Translator .
Click to show internal directories.
Click to hide internal directories.