diff --git a/apps/authentication/api/mfa.py b/apps/authentication/api/mfa.py index cc4f2ab6b..f95593bbe 100644 --- a/apps/authentication/api/mfa.py +++ b/apps/authentication/api/mfa.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # import time +from django.utils.translation import ugettext as _ from rest_framework.permissions import AllowAny from rest_framework.generics import CreateAPIView from rest_framework.serializers import ValidationError @@ -56,4 +57,4 @@ class UserOtpVerifyApi(CreateAPIView): request.session["MFA_VERIFY_TIME"] = int(time.time()) return Response({"ok": "1"}) else: - return Response({"error": "Code not valid"}, status=400) + return Response({"error": _("Code is invalid")}, status=400) diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 331ae38c7..7889bc373 100644 Binary files a/apps/locale/zh/LC_MESSAGES/django.mo and b/apps/locale/zh/LC_MESSAGES/django.mo differ diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index a374c7e20..bc137d200 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: JumpServer 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-15 12:32+0800\n" +"POT-Creation-Date: 2020-06-15 20:30+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -986,7 +986,7 @@ msgstr "状态" msgid "Date login" msgstr "登录日期" -#: audits/serializers.py:61 audits/serializers.py:73 ops/models/adhoc.py:240 +#: audits/serializers.py:61 audits/serializers.py:73 ops/models/adhoc.py:244 msgid "Is success" msgstr "是否成功" @@ -1003,6 +1003,10 @@ msgstr "主机" msgid "Run as" msgstr "运行用户" +#: authentication/api/mfa.py:60 +msgid "Code is invalid" +msgstr "Code无效" + #: authentication/backends/api.py:53 msgid "Invalid signature header. No credentials provided." msgstr "" @@ -1500,46 +1504,46 @@ msgstr "Become" msgid "Create by" msgstr "创建者" -#: ops/models/adhoc.py:233 +#: ops/models/adhoc.py:237 msgid "Task display" msgstr "任务展示" -#: ops/models/adhoc.py:234 +#: ops/models/adhoc.py:238 msgid "Host amount" msgstr "主机数量" -#: ops/models/adhoc.py:236 +#: ops/models/adhoc.py:240 msgid "Start time" msgstr "开始时间" -#: ops/models/adhoc.py:237 +#: ops/models/adhoc.py:241 msgid "End time" msgstr "完成时间" -#: ops/models/adhoc.py:238 xpack/plugins/change_auth_plan/models.py:179 +#: ops/models/adhoc.py:242 xpack/plugins/change_auth_plan/models.py:179 #: xpack/plugins/change_auth_plan/models.py:310 #: xpack/plugins/gathered_user/models.py:79 msgid "Time" msgstr "时间" -#: ops/models/adhoc.py:239 ops/models/command.py:26 +#: ops/models/adhoc.py:243 ops/models/command.py:26 #: terminal/serializers/session.py:30 msgid "Is finished" msgstr "是否完成" -#: ops/models/adhoc.py:241 +#: ops/models/adhoc.py:245 msgid "Adhoc raw result" msgstr "结果" -#: ops/models/adhoc.py:242 +#: ops/models/adhoc.py:246 msgid "Adhoc result summary" msgstr "汇总" -#: ops/models/adhoc.py:282 xpack/plugins/change_auth_plan/utils.py:137 +#: ops/models/adhoc.py:286 xpack/plugins/change_auth_plan/utils.py:137 msgid "{} Start task: {}" msgstr "{} 任务开始: {}" -#: ops/models/adhoc.py:291 xpack/plugins/change_auth_plan/utils.py:149 +#: ops/models/adhoc.py:295 xpack/plugins/change_auth_plan/utils.py:149 msgid "{} Task finish" msgstr "{} 任务结束"