Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultLang string = "en"
DefaultLang stores the default language for translations
Functions ¶
Types ¶
type Localizer ¶
type Localizer struct { ID string // contains filtered or unexported fields }
Localizer is a type which stores the relevant locale ID (as used in our URLs) and a (deliberately unexported) message.Printer instance for the locale.
func Get ¶
Get function accepts a locale ID and returns the corresponding Localizer for that locale. If the locale ID is not supported then this returns `false` as the second return value.
func GetGlobal ¶
GetGlobal returns a message.Printer based on the default catalog. This is just a helper for outside applications using gobwebs
func (*Localizer) Translate ¶
Translate method to the Localizer type. This acts as a wrapper around the unexported message.Printer's Sprintf() function and returns the appropriate translation for the given message and arguments.