fix: 修复i8n 500 (#9848)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2023-03-02 16:23:02 +08:00
committed by GitHub
parent fad214ccbb
commit 8c4e496391

View File

@@ -35,7 +35,10 @@ def i18n_trans(s):
tpl, args = s.split(' % ', 1)
args = args.split(', ')
args = [gettext(arg) for arg in args]
return gettext(tpl) % tuple(args)
try:
return gettext(tpl) % tuple(args)
except TypeError:
return gettext(tpl)
def hello():