Documentation ¶
Overview ¶
Package translation provides a simple in-memory translation service - it may soon be renamed translate
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLanguage = "en"
DefaultLanguage defines a default language to fall back to
Functions ¶
func Get ¶
Get returns the translation for a given language and key if no result, it falls back to DefaultLanguage + key
func Load ¶
Load scans the path for translation lang.json files if called twice the second translations will overwrite any common keys
func Middleware ¶ added in v1.5.7
func Middleware(h http.HandlerFunc) http.HandlerFunc
Middleware sets a token on every GET request so that it can be inserted into the view. It ignores get requests for /files and /assets.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.