68843a626d
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
35 lines
539 B
Go
35 lines
539 B
Go
package i18n
|
|
|
|
import "strings"
|
|
|
|
type Language string
|
|
|
|
type LanguageMap map[Language]MessageMap
|
|
|
|
const (
|
|
English Language = "en"
|
|
Dutch Language = "nl"
|
|
French Language = "fr"
|
|
German Language = "de"
|
|
Russian Language = "ru"
|
|
Default = English
|
|
)
|
|
|
|
var Languages = LanguageMap{
|
|
English: MsgEnglish,
|
|
Dutch: MsgDutch,
|
|
French: MsgFrench,
|
|
German: MsgGerman,
|
|
Russian: MsgRussian,
|
|
}
|
|
|
|
var Lang = Default
|
|
|
|
func SetLang(s string) {
|
|
if len(s) != 2 {
|
|
Lang = Default
|
|
} else {
|
|
s = strings.ToLower(s)
|
|
Lang = Language(s)
|
|
}
|
|
}
|