forked from External/ergo
Handle translations a little better
This commit is contained in:
parent
e1553aa912
commit
7eef390756
3 changed files with 31 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue