perf: 登录界面文案优化 (#12849)

Co-authored-by: feng <1304903146@qq.com>
pull/12869/head
fit2bot 2024-03-21 16:21:44 +08:00 committed by GitHub
parent d71374ca8a
commit 02c2ee8c54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 38 additions and 84 deletions

View File

@ -17,10 +17,6 @@ class EncryptedField(forms.CharField):
class UserLoginForm(forms.Form):
days_auto_login = int(settings.SESSION_COOKIE_AGE / 3600 / 24)
disable_days_auto_login = settings.SESSION_EXPIRE_AT_BROWSER_CLOSE \
or days_auto_login < 1
username = forms.CharField(
label=_('Username'), max_length=100,
widget=forms.TextInput(attrs={
@ -34,16 +30,14 @@ class UserLoginForm(forms.Form):
)
auto_login = forms.BooleanField(
required=False, initial=False,
widget=forms.CheckboxInput(
attrs={'disabled': disable_days_auto_login}
)
widget=forms.CheckboxInput()
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
auto_login_field = self.fields['auto_login']
auto_login_field.label = _("{} days auto login").format(self.days_auto_login or 1)
if self.disable_days_auto_login:
auto_login_field.label = _("Auto login")
if settings.SESSION_EXPIRE_AT_BROWSER_CLOSE:
auto_login_field.widget = forms.HiddenInput()
def confirm_login_allowed(self, user):

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:95de4aab904b7184223c9655d5381e1cb9b51abe4eaf9b9ab314b16dd32eca2d
size 174874
oid sha256:755f33d4fd95db901868dfc25845e29a21f36c3ed691a7f16ecc7ef01f95de26
size 174860

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-21 11:15+0800\n"
"POT-Creation-Date: 2024-03-21 16:18+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -31,7 +31,7 @@ msgstr "成功: %s、失敗: %s、合計: %s"
#: accounts/serializers/automations/change_secret.py:34
#: assets/models/_user.py:24 audits/signal_handlers/login_log.py:34
#: authentication/confirm/password.py:9 authentication/confirm/password.py:24
#: authentication/confirm/password.py:26 authentication/forms.py:32
#: authentication/confirm/password.py:26 authentication/forms.py:28
#: authentication/templates/authentication/login.html:330
#: settings/serializers/auth/ldap.py:25 settings/serializers/auth/ldap.py:47
#: settings/serializers/msg.py:35 terminal/serializers/storage.py:123
@ -538,7 +538,7 @@ msgstr "最終ログイン日"
#: accounts/models/automations/push_account.py:15 accounts/models/base.py:65
#: accounts/serializers/account/virtual.py:21 acls/serializers/base.py:19
#: acls/serializers/base.py:50 assets/models/_user.py:23 audits/models.py:188
#: authentication/forms.py:25 authentication/forms.py:27
#: authentication/forms.py:21 authentication/forms.py:23
#: authentication/models/temp_token.py:9
#: authentication/templates/authentication/_msg_different_city.html:9
#: authentication/templates/authentication/_msg_oauth_bind.html:9
@ -757,6 +757,7 @@ msgstr ""
msgid "Gather account change information"
msgstr "アカウント変更情報"
#: accounts/notifications.py:105
msgid "Change secret or push account failed information"
msgstr "パスワード変更またはアカウントプッシュ失敗情報"
@ -1080,6 +1081,7 @@ msgstr "アカウントの削除"
msgid "Task name"
msgstr "タスク名"
#: accounts/templates/accounts/change_secret_failed_info.html:4
msgid "Task execution id"
msgstr "タスク実行ID"
@ -1093,7 +1095,9 @@ msgstr "尊敬する"
msgid ""
"Hello! The following is the failure of changing the password of your assets "
"or pushing the account. Please check and handle it in time."
msgstr "こんにちは! アセットの変更またはアカウントのプッシュが失敗する状況は次のとおりです。 時間内に確認して対処してください。"
msgstr ""
"こんにちは! アセットの変更またはアカウントのプッシュが失敗する状況は次のとお"
"りです。 時間内に確認して対処してください。"
#: accounts/utils.py:52
msgid ""
@ -3002,28 +3006,28 @@ msgid "Your password has expired, please reset before logging in"
msgstr ""
"パスワードの有効期限が切れました。ログインする前にリセットしてください。"
#: authentication/forms.py:45
msgid "{} days auto login"
msgstr "{} 日自動ログイン"
#: authentication/forms.py:39
msgid "Auto login"
msgstr "自動ログイン"
#: authentication/forms.py:58
#: authentication/forms.py:52
msgid "MFA Code"
msgstr "MFAコード"
#: authentication/forms.py:59
#: authentication/forms.py:53
msgid "MFA type"
msgstr "MFAタイプ"
#: authentication/forms.py:67
#: authentication/forms.py:61
#: authentication/templates/authentication/_captcha_field.html:15
msgid "Captcha"
msgstr "キャプチャ"
#: authentication/forms.py:72 users/forms/profile.py:28
#: authentication/forms.py:66 users/forms/profile.py:28
msgid "MFA code"
msgstr "MFAコード"
#: authentication/forms.py:74
#: authentication/forms.py:68
msgid "Dynamic code"
msgstr "動的コード"
@ -7217,6 +7221,7 @@ msgstr "参加できます"
msgid "Can terminate"
msgstr "終了できます"
#: terminal/serializers/session.py:47
msgid "Duration"
msgstr "間隔"
@ -9243,27 +9248,3 @@ msgstr "エンタープライズプロフェッショナル版"
#: xpack/plugins/license/models.py:86
msgid "Ultimate edition"
msgstr "エンタープライズ・フラッグシップ・エディション"
#~ msgid "SMTP port"
#~ msgstr "SMTPポート"
#~ msgid "SMTP account"
#~ msgstr "SMTPアカウント"
#~ msgid "SMTP password"
#~ msgstr "SMTPパスワード"
#~ msgid "Password can not contains `{{` or `}}`"
#~ msgstr "パスワードには `{` または `}` 文字を含めることはできません"
#~ msgid "Password can not contains `{%` or `%}`"
#~ msgstr "パスワードには `{%` または `%}` 文字を含めることはできません"
#~ msgid "FeiShu query user failed"
#~ msgstr "FeiShuクエリユーザーが失敗しました"
#~ msgid "The FeiShu is already bound to another user"
#~ msgstr "FeiShuはすでに別のユーザーにバインドされています"
#~ msgid "Binding FeiShu successfully"
#~ msgstr "本を飛ばすのバインドに成功"

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d1bd2caeac7fd9717470006f8147932916b6ba5b5a13f844e9b15655991d4591
size 143125
oid sha256:98162bd049b3ad332925883690437df7abda231541ec02df6722ffc766576e5c
size 143108

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: JumpServer 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-21 11:15+0800\n"
"POT-Creation-Date: 2024-03-21 16:18+0800\n"
"PO-Revision-Date: 2021-05-20 10:54+0800\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: JumpServer team<ibuler@qq.com>\n"
@ -30,7 +30,7 @@ msgstr "成功: %s, 失败: %s, 总数: %s"
#: accounts/serializers/automations/change_secret.py:34
#: assets/models/_user.py:24 audits/signal_handlers/login_log.py:34
#: authentication/confirm/password.py:9 authentication/confirm/password.py:24
#: authentication/confirm/password.py:26 authentication/forms.py:32
#: authentication/confirm/password.py:26 authentication/forms.py:28
#: authentication/templates/authentication/login.html:330
#: settings/serializers/auth/ldap.py:25 settings/serializers/auth/ldap.py:47
#: settings/serializers/msg.py:35 terminal/serializers/storage.py:123
@ -537,7 +537,7 @@ msgstr "最后登录日期"
#: accounts/models/automations/push_account.py:15 accounts/models/base.py:65
#: accounts/serializers/account/virtual.py:21 acls/serializers/base.py:19
#: acls/serializers/base.py:50 assets/models/_user.py:23 audits/models.py:188
#: authentication/forms.py:25 authentication/forms.py:27
#: authentication/forms.py:21 authentication/forms.py:23
#: authentication/models/temp_token.py:9
#: authentication/templates/authentication/_msg_different_city.html:9
#: authentication/templates/authentication/_msg_oauth_bind.html:9
@ -755,6 +755,7 @@ msgstr ""
msgid "Gather account change information"
msgstr "账号变更信息"
#: accounts/notifications.py:105
msgid "Change secret or push account failed information"
msgstr "改密或推送账号失败信息"
@ -1077,6 +1078,7 @@ msgstr "删除账号"
msgid "Task name"
msgstr "任务名称"
#: accounts/templates/accounts/change_secret_failed_info.html:4
msgid "Task execution id"
msgstr "任务执行 ID"
@ -2973,28 +2975,28 @@ msgstr "登录完成前,请先修改密码"
msgid "Your password has expired, please reset before logging in"
msgstr "您的密码已过期,先修改再登录"
#: authentication/forms.py:45
msgid "{} days auto login"
msgstr "{} 天内自动登录"
#: authentication/forms.py:39
msgid "Auto login"
msgstr "自动登录"
#: authentication/forms.py:58
#: authentication/forms.py:52
msgid "MFA Code"
msgstr "MFA 验证码"
#: authentication/forms.py:59
#: authentication/forms.py:53
msgid "MFA type"
msgstr "MFA 类型"
#: authentication/forms.py:67
#: authentication/forms.py:61
#: authentication/templates/authentication/_captcha_field.html:15
msgid "Captcha"
msgstr "验证码"
#: authentication/forms.py:72 users/forms/profile.py:28
#: authentication/forms.py:66 users/forms/profile.py:28
msgid "MFA code"
msgstr "MFA 验证码"
#: authentication/forms.py:74
#: authentication/forms.py:68
msgid "Dynamic code"
msgstr "动态码"
@ -7116,6 +7118,7 @@ msgstr "是否可加入"
msgid "Can terminate"
msgstr "是否可中断"
#: terminal/serializers/session.py:47
msgid "Duration"
msgstr "期间"
@ -9116,27 +9119,3 @@ msgstr "企业专业版"
#: xpack/plugins/license/models.py:86
msgid "Ultimate edition"
msgstr "企业旗舰版"
#~ msgid "SMTP port"
#~ msgstr "SMTP 端口"
#~ msgid "SMTP account"
#~ msgstr "SMTP 账号"
#~ msgid "SMTP password"
#~ msgstr "SMTP 密码"
#~ msgid "Password can not contains `{{` or `}}`"
#~ msgstr "密码不能包含 `{{` 或 `}}` 字符"
#~ msgid "Password can not contains `{%` or `%}`"
#~ msgstr "密码不能包含 `{%` 或 `%}` 字符"
#~ msgid "FeiShu query user failed"
#~ msgstr "飞书查询用户失败"
#~ msgid "The FeiShu is already bound to another user"
#~ msgstr "该飞书已经绑定其他用户"
#~ msgid "Binding FeiShu successfully"
#~ msgstr "绑定 飞书 成功"