Documentation ¶
Overview ¶
Package locale handles the internationalization of the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AvailableLanguages ¶
AvailableLanguages returns the list of available languages.
Types ¶
type Language ¶
type Language struct {
// contains filtered or unexported fields
}
Language represents a language in the system.
type Locales ¶
type Locales map[string]Translation
Locales represents locales supported by the system.
type Translation ¶
type Translation map[string]interface{}
Translation is the translation mapping table.
type Translator ¶
type Translator struct {
// contains filtered or unexported fields
}
Translator manage supported locales.
func (*Translator) AddLanguage ¶
func (t *Translator) AddLanguage(language, translations string) error
AddLanguage loads a new language into the system.
func (*Translator) GetLanguage ¶
func (t *Translator) GetLanguage(language string) *Language
GetLanguage returns the given language handler.
Click to show internal directories.
Click to hide internal directories.