summaryrefslogtreecommitdiffstats
path: root/modules/translation
diff options
context:
space:
mode:
Diffstat (limited to 'modules/translation')
-rw-r--r--modules/translation/translation.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/modules/translation/translation.go b/modules/translation/translation.go
index b7276e53c0..dec48c7a65 100644
--- a/modules/translation/translation.go
+++ b/modules/translation/translation.go
@@ -5,8 +5,6 @@
package translation
import (
- "errors"
-
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/options"
"code.gitea.io/gitea/modules/setting"
@@ -38,6 +36,7 @@ func AllLangs() []LangType {
// InitLocales loads the locales
func InitLocales() {
+ i18n.Reset()
localeNames, err := options.Dir("locale")
if err != nil {
log.Fatal("Failed to list locale files: %v", err)
@@ -60,12 +59,7 @@ func InitLocales() {
for i := range setting.Names {
key := "locale_" + setting.Langs[i] + ".ini"
if err = i18n.SetMessageWithDesc(setting.Langs[i], setting.Names[i], localFiles[key]); err != nil {
- if errors.Is(err, i18n.ErrLangAlreadyExist) {
- // just log if lang is already loaded since we can not reload it
- log.Warn("Can not load language '%s' since already loaded", setting.Langs[i])
- } else {
- log.Error("Failed to set messages to %s: %v", setting.Langs[i], err)
- }
+ log.Error("Failed to set messages to %s: %v", setting.Langs[i], err)
}
}
i18n.SetDefaultLang("en-US")