1
0
Fork 0
forked from External/ergo

Handle translations a little better

This commit is contained in:
Daniel Oaks 2019-02-04 03:54:10 +10:00
parent e1553aa912
commit 7eef390756
3 changed files with 31 additions and 9 deletions

View file

@ -697,12 +697,13 @@ func LoadConfig(filename string) (config *Config, err error) {
return nil, fmt.Errorf("Cannot have language file with code 'en' (this is the default language using strings inside the server code). If you're making an English variant, name it with a more specific code")
}
if langInfo.Code == "" || langInfo.Name == "" || langInfo.Contributors == "" {
return nil, fmt.Errorf("Code, name or contributors is empty in language file [%s]", name)
if len(langInfo.Translations) == 0 {
// skip empty translations
continue
}
if len(langInfo.Translations) == 0 {
return nil, fmt.Errorf("Language [%s / %s] contains no translations", langInfo.Code, langInfo.Name)
if langInfo.Code == "" || langInfo.Name == "" || langInfo.Contributors == "" {
return nil, fmt.Errorf("Code, name or contributors is empty in language file [%s]", name)
}
// check for duplicate languages