Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Use ¶
func Use(trans Translator) template.Option
Use registers the `$t` function in the templates. `$t` delegates the calls to `trans.Translate()`.
Types ¶
type Translator ¶
type Translator interface {
Translate(key, locale string, data map[string]interface{}) (string, error)
}
Translator translates message keys to human readable messages.
type TranslatorFunc ¶
TranslatorFunc allows functions to be used as a `Translator`.
Click to show internal directories.
Click to hide internal directories.