mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-31 11:13:05 -07:00
Handle translations a little better
This commit is contained in:
+5
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user