Documentation ¶
Index ¶
- Constants
- type Renderer
- func (r *Renderer) AddMessages(translator *i18n.Translator, tag language.Tag, messages ...i18n.Message) error
- func (r *Renderer) Localize(translator *i18n.Translator, id string, args map[string]interface{}) string
- func (r *Renderer) LocalizeFromRequest(translator *i18n.Translator, req *http.Request, id string, ...) string
- func (r *Renderer) NewTranslator() (*i18n.Translator, error)
- func (r *Renderer) RenderTemplate(w http.ResponseWriter, req *http.Request, translator *i18n.Translator, ...)
- func (r *Renderer) ReqLang(translator *i18n.Translator, req *http.Request) language.Tag
Constants ¶
View Source
const (
TranslateFn = "t"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Renderer ¶
type Renderer struct { Templates map[string]*template.Template // contains filtered or unexported fields }
func NewRenderer ¶
func NewRenderer(dir http.FileSystem, tmplMapping map[string]string, funcs map[string]interface{}, translatorConfig i18n.TranslatorConfig) (*Renderer, error)
func (*Renderer) AddMessages ¶
func (*Renderer) LocalizeFromRequest ¶
func (*Renderer) NewTranslator ¶
func (r *Renderer) NewTranslator() (*i18n.Translator, error)
func (*Renderer) RenderTemplate ¶
func (r *Renderer) RenderTemplate(w http.ResponseWriter, req *http.Request, translator *i18n.Translator, tmpl *template.Template, data interface{}, reqFuncs map[string]interface{})
Click to show internal directories.
Click to hide internal directories.