From 4df58e6048afee9e2bd1564faeab9c651772b95d Mon Sep 17 00:00:00 2001 From: arraykeys Date: Wed, 15 May 2024 15:48:34 +0800 Subject: [PATCH] gi18n --- module/i18n/i18n.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/i18n/i18n.go b/module/i18n/i18n.go index 79a72010..beb167d6 100644 --- a/module/i18n/i18n.go +++ b/module/i18n/i18n.go @@ -52,7 +52,7 @@ func (this *I18n) Tr(lang, key string, defaultMessage ...string) string { } for _, k := range []string{strings.ToLower(lang), this.fallbackLang} { if v, ok := this.langs[k]; ok { - if vv, ok := v[key]; ok { + if vv, ok := v[key]; ok && vv != "" { return vv } } @@ -69,7 +69,7 @@ func (this *I18n) TrLangs(langs []string, key string, defaultMessage ...string) for _, k := range langs { k = strings.ToLower(k) if v, ok := this.langs[k]; ok { - if vv, ok := v[key]; ok { + if vv, ok := v[key]; ok && vv != "" { return vv } }