./locales
directory. Within this directory there should be a subdirectory for each language supported by the application:$ go get -u github.com/go-bindata/go-bindata/...
$ go-bindata -o locales.go ./locales/...
LoadAssets
method to initialize and load the languagesAssetNames
and Asset
functions are generated by go-bindata
string
or map
containing by its translated text (or template) or/and its pluralized key-values.Vars
key.one
"=x"
where x is a number"<x"
other
format
zero
one
two
"=x"
"<x"
">x"
other
.
).context.GetLocale
method to determine the current locale or check if the locale is a given value:context.Tr
method as a shortcut to get a translated text for this request.