photoprism/internal/i18n/lang.go
Michael Mayer 68fac9e8a8 Translations: Add Spanish, French and Polish
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-07-08 08:19:29 +02:00

43 lines
786 B
Go

package i18n
import "strings"
type Language string
type LanguageMap map[Language]MessageMap
const (
German Language = "de"
English Language = "en"
Spanish Language = "es"
French Language = "fr"
Dutch Language = "nl"
Polish Language = "pl"
Portuguese Language = "pt"
Russian Language = "ru"
Chinese Language = "zh"
Default = English
)
var Languages = LanguageMap{
German: MsgGerman,
English: MsgEnglish,
Spanish: MsgSpanish,
French: MsgFrench,
Dutch: MsgDutch,
Polish: MsgPolish,
Portuguese: MsgPortuguese,
Russian: MsgRussian,
Chinese: MsgChinese,
}
var Lang = Default
func SetLang(s string) {
if len(s) != 2 {
Lang = Default
} else {
s = strings.ToLower(s)
Lang = Language(s)
}
}