[Update] 修改mfa校验code无效翻译

pull/4107/head
Bai 2020-06-15 20:31:50 +08:00
parent c5a9a85818
commit f4fa011714
3 changed files with 18 additions and 13 deletions

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
import time import time
from django.utils.translation import ugettext as _
from rest_framework.permissions import AllowAny from rest_framework.permissions import AllowAny
from rest_framework.generics import CreateAPIView from rest_framework.generics import CreateAPIView
from rest_framework.serializers import ValidationError from rest_framework.serializers import ValidationError
@ -56,4 +57,4 @@ class UserOtpVerifyApi(CreateAPIView):
request.session["MFA_VERIFY_TIME"] = int(time.time()) request.session["MFA_VERIFY_TIME"] = int(time.time())
return Response({"ok": "1"}) return Response({"ok": "1"})
else: else:
return Response({"error": "Code not valid"}, status=400) return Response({"error": _("Code is invalid")}, status=400)

Binary file not shown.

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: JumpServer 0.3.3\n" "Project-Id-Version: JumpServer 0.3.3\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: ibuler <ibuler@qq.com>\n" "Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: JumpServer team<ibuler@qq.com>\n" "Language-Team: JumpServer team<ibuler@qq.com>\n"
@ -986,7 +986,7 @@ msgstr "状态"
msgid "Date login" msgid "Date login"
msgstr "登录日期" 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" msgid "Is success"
msgstr "是否成功" msgstr "是否成功"
@ -1003,6 +1003,10 @@ msgstr "主机"
msgid "Run as" msgid "Run as"
msgstr "运行用户" msgstr "运行用户"
#: authentication/api/mfa.py:60
msgid "Code is invalid"
msgstr "Code无效"
#: authentication/backends/api.py:53 #: authentication/backends/api.py:53
msgid "Invalid signature header. No credentials provided." msgid "Invalid signature header. No credentials provided."
msgstr "" msgstr ""
@ -1500,46 +1504,46 @@ msgstr "Become"
msgid "Create by" msgid "Create by"
msgstr "创建者" msgstr "创建者"
#: ops/models/adhoc.py:233 #: ops/models/adhoc.py:237
msgid "Task display" msgid "Task display"
msgstr "任务展示" msgstr "任务展示"
#: ops/models/adhoc.py:234 #: ops/models/adhoc.py:238
msgid "Host amount" msgid "Host amount"
msgstr "主机数量" msgstr "主机数量"
#: ops/models/adhoc.py:236 #: ops/models/adhoc.py:240
msgid "Start time" msgid "Start time"
msgstr "开始时间" msgstr "开始时间"
#: ops/models/adhoc.py:237 #: ops/models/adhoc.py:241
msgid "End time" msgid "End time"
msgstr "完成时间" 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/change_auth_plan/models.py:310
#: xpack/plugins/gathered_user/models.py:79 #: xpack/plugins/gathered_user/models.py:79
msgid "Time" msgid "Time"
msgstr "时间" 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 #: terminal/serializers/session.py:30
msgid "Is finished" msgid "Is finished"
msgstr "是否完成" msgstr "是否完成"
#: ops/models/adhoc.py:241 #: ops/models/adhoc.py:245
msgid "Adhoc raw result" msgid "Adhoc raw result"
msgstr "结果" msgstr "结果"
#: ops/models/adhoc.py:242 #: ops/models/adhoc.py:246
msgid "Adhoc result summary" msgid "Adhoc result summary"
msgstr "汇总" 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: {}" msgid "{} Start task: {}"
msgstr "{} 任务开始: {}" 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" msgid "{} Task finish"
msgstr "{} 任务结束" msgstr "{} 任务结束"