Skip to content

Commit

Permalink
gi18n
Browse files Browse the repository at this point in the history
  • Loading branch information
snail007 committed May 15, 2024
1 parent 9935139 commit 4df58e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/i18n/i18n.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand All @@ -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
}
}
Expand Down

0 comments on commit 4df58e6

Please sign in to comment.