Documentation ¶
Index ¶
- type Instance
- func (v Instance) GetLanguage() language.Tag
- func (v Instance) GetParametrizedTranslation(name string, values map[string]string) string
- func (v Instance) GetTranslation(name string) string
- func (v Instance) GetTranslations() map[string]string
- func (v *Instance) SetLanguage(lang string) *Instance
- func (v *Instance) SetLanguageFromRequest(r *http.Request) *Instance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance vertimas instance
func CreateInstance ¶
CreateInstance creates vertimas instance and loads .json translation files from given path
func CreateInstanceWithPanic ¶
CreateInstanceWithPanic creates vertimas instance with panic if file loading fails
func (Instance) GetLanguage ¶
GetLanguage gets current language
func (Instance) GetParametrizedTranslation ¶
GetParametrizedTranslation gets translation from current language with {token} replaced from values map
func (Instance) GetTranslation ¶
GetTranslation gets translation from current language
func (Instance) GetTranslations ¶
GetTranslations gets translation map for current language
func (*Instance) SetLanguage ¶
SetLanguage sets current language
Click to show internal directories.
Click to hide internal directories.