Language selection combobox in options and accepted languages.
Added language selection combobox in options dialog. Selecting language here will overwrite language code gathered from system. Added AcceptedLanguages map to Translator, which holds readable names and lang-country codes with avaailable languages. Filled it with languages in which URTrator already translated. Francais coming :)
This commit is contained in:
@@ -73,6 +73,7 @@ func (t *Translator) detectTranslationsDirectory() error {
|
||||
if err != nil {
|
||||
t.Language = "en_US"
|
||||
fmt.Println("Translations unavailable, forcing en_US language code")
|
||||
return errors.New("No translations directory was detected!")
|
||||
} else {
|
||||
t.translationsPath = "/usr/share/urtrator/translations"
|
||||
}
|
||||
@@ -80,11 +81,5 @@ func (t *Translator) detectTranslationsDirectory() error {
|
||||
t.translationsPath = translations_dir
|
||||
}
|
||||
|
||||
if t.translationsPath != "" {
|
||||
t.translationsPath = filepath.Join(t.translationsPath, t.Language)
|
||||
} else {
|
||||
return errors.New("No translations directory was detected!")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user