From 22f3caa954be2911fd39092b3a471122c3bd0fc8 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Thu, 2 Mar 2023 16:18:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Di8n=20500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/utils/translate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/common/utils/translate.py b/apps/common/utils/translate.py index 2a9a74ca8..ec465502b 100644 --- a/apps/common/utils/translate.py +++ b/apps/common/utils/translate.py @@ -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():