Archived
1
0
This commit is contained in:
Jeff Becker 2019-02-13 08:37:04 -05:00
parent e13dcf9e20
commit 8f7d57f64d
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -36,9 +36,6 @@ func InitI18n(locale, dir string) {
} }
func NewI18n(locale, dir string) (*I18N, error) { func NewI18n(locale, dir string) (*I18N, error) {
if locale == "und" {
locale = "en"
}
log.Println("get locale", locale) log.Println("get locale", locale)
pref := language.Make(locale) // falls back to en-US on parse error pref := language.Make(locale) // falls back to en-US on parse error
files, err := ioutil.ReadDir(dir) files, err := ioutil.ReadDir(dir)
@ -48,7 +45,7 @@ func NewI18n(locale, dir string) (*I18N, error) {
found := false found := false
serverLangs := make([]language.Tag, 1) serverLangs := make([]language.Tag, 1)
// serverLangs[0] = language.AmericanEnglish // en-US fallback serverLangs[0] = language.AmericanEnglish // en-US fallback
for _, file := range files { for _, file := range files {
if filepath.Ext(file.Name()) == ".ini" { if filepath.Ext(file.Name()) == ".ini" {
name := strings.TrimSuffix(file.Name(), ".ini") name := strings.TrimSuffix(file.Name(), ".ini")