6e546facc0
- Fixed an error in the spanish and chinese translation file - Refactored reading the translation files Instead of ignoring errors in the non-default language files the error will now be returned and the remaining files will not be loaded. - Added a unit test to check if all translation files are valid - Added an i18n config to specify the translations dir and the default language
11 lignes
333 o
Go
11 lignes
333 o
Go
package config
|
|
|
|
type I18nConfig struct {
|
|
TranslationsDirectory string `json:"translations_directory"`
|
|
DefaultLanguage string `json:"default_language"`
|
|
}
|
|
|
|
var DefaultI18nConfig = I18nConfig{
|
|
TranslationsDirectory: "translations",
|
|
DefaultLanguage: "en-us", // TODO: Remove refs to "en-us" from the code and templates
|
|
}
|