feat: 修改翻译,添加settings

pull/4107/head
ibuler 5 years ago
parent e23bfa0f69
commit 1f15937139

@ -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-16 11:02+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: JumpServer team<ibuler@qq.com>\n"
@ -2716,6 +2716,14 @@ msgstr "角色只能为 {}"
msgid "Password does not match security rules"
msgstr "密码不满足安全规则"
#: users/serializers/user.py:274
msgid "The old password is incorrect"
msgstr "旧密码错误"
#: users/serializers/user.py:288
msgid "The newly set password is inconsistent"
msgstr "两次密码不一致"
#: users/serializers_v2/user.py:36
msgid "name not unique"
msgstr "名称重复"

@ -275,7 +275,14 @@ class PublicSettingApi(generics.RetrieveAPIView):
"LOGIN_CONFIRM_ENABLE": settings.LOGIN_CONFIRM_ENABLE,
"SECURITY_VIEW_AUTH_NEED_MFA": settings.SECURITY_VIEW_AUTH_NEED_MFA,
"SECURITY_MFA_VERIFY_TTL": settings.SECURITY_MFA_VERIFY_TTL,
"LOGO_URLS": settings.LOGO_URLS
"LOGO_URLS": settings.LOGO_URLS,
"PASSWORD_RULE": {
'SECURITY_PASSWORD_MIN_LENGTH': settings.SECURITY_PASSWORD_MIN_LENGTH,
'SECURITY_PASSWORD_UPPER_CASE': settings.SECURITY_PASSWORD_UPPER_CASE,
'SECURITY_PASSWORD_LOWER_CASE': settings.SECURITY_PASSWORD_LOWER_CASE,
'SECURITY_PASSWORD_NUMBER': settings.SECURITY_PASSWORD_NUMBER,
'SECURITY_PASSWORD_SPECIAL_CHAR': settings.SECURITY_PASSWORD_SPECIAL_CHAR,
}
}
}
return instance

@ -271,7 +271,7 @@ class UserUpdatePasswordSerializer(serializers.ModelSerializer):
def validate_old_password(self, value):
if not self.instance.check_password(value):
msg = 'The old password is incorrect'
msg = _('The old password is incorrect')
raise serializers.ValidationError(msg)
return value
@ -285,7 +285,7 @@ class UserUpdatePasswordSerializer(serializers.ModelSerializer):
def validate_new_password_again(self, value):
if value != self.initial_data.get('new_password', ''):
msg = 'The newly set password is inconsistent'
msg = _('The newly set password is inconsistent')
raise serializers.ValidationError(msg)
return value

Loading…
Cancel
Save