fix: 修复i8n 500 (#9848)

Co-authored-by: feng <1304903146@qq.com>
pull/9872/head
fit2bot 2023-03-02 16:23:02 +08:00 committed by GitHub
parent fad214ccbb
commit 8c4e496391
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

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():