perf: 优化资产授权过期提示信息

pull/12294/head
wangruidong 2023-12-11 11:14:36 +08:00 committed by Bryan
parent 85fedf0704
commit c312cdb625
4 changed files with 31 additions and 18 deletions

View File

@ -4567,6 +4567,10 @@ msgstr "認定アカウント"
msgid "today"
msgstr "今日"
#: perms/notifications.py:12 settings/serializers/feature.py:106
msgid "day"
msgstr "日"
#: perms/notifications.py:15
msgid "You permed assets is about to expire"
msgstr "パーマ資産の有効期限が近づいています"
@ -4591,16 +4595,15 @@ msgstr "アセット認証ルールの有効期限が切れていることを確
msgid "Send asset permission expired notification"
msgstr "アセット許可の有効期限通知を送信する"
#: perms/templates/perms/_msg_item_permissions_expire.html:7
#: perms/templates/perms/_msg_permed_items_expire.html:7
#, python-format
msgid ""
"\n"
" The following %(item_type)s will expire in %(count)s days\n"
" The following %(item_type)s will expire in %(count)s\n"
" "
msgstr ""
"\n"
" 次の %(item_type)s は %(count)s 以内に期限切れになります\n"
" 次の %(item_type)s は %(count)s 以内に期限切れになります\n"
" "
#: rbac/api/role.py:35
@ -5512,10 +5515,6 @@ msgstr "チケットを有効にする"
msgid "Ticket authorize default time"
msgstr "デフォルト製造オーダ承認時間"
#: settings/serializers/feature.py:106
msgid "day"
msgstr "日"
#: settings/serializers/feature.py:106
msgid "hour"
msgstr "時"

View File

@ -4516,6 +4516,10 @@ msgstr "授权账号"
msgid "today"
msgstr "今天"
#: perms/notifications.py:12 settings/serializers/feature.py:106
msgid "day"
msgstr "天"
#: perms/notifications.py:15
msgid "You permed assets is about to expire"
msgstr "你授权的资产即将到期"
@ -4541,15 +4545,29 @@ msgid "Send asset permission expired notification"
msgstr "发送资产权限过期通知"
#: perms/templates/perms/_msg_item_permissions_expire.html:7
#: perms/templates/perms/_msg_permed_items_expire.html:7
#, python-format
#, fuzzy, python-format
#| msgid ""
#| "\n"
#| " The following %(item_type)s will expire in %(count)s\n"
#| " "
msgid ""
"\n"
" The following %(item_type)s will expire in %(count)s days\n"
" "
msgstr ""
"\n"
" 以下 %(item_type)s 即将在 %(count)s 天后过期\n"
" 以下 %(item_type)s 即将在 %(count)s 后过期\n"
" "
#: perms/templates/perms/_msg_permed_items_expire.html:7
#, python-format
msgid ""
"\n"
" The following %(item_type)s will expire in %(count)s\n"
" "
msgstr ""
"\n"
" 以下 %(item_type)s 即将在 %(count)s 后过期\n"
" "
#: rbac/api/role.py:35
@ -5454,10 +5472,6 @@ msgstr "启用工单"
msgid "Ticket authorize default time"
msgstr "默认工单授权时间"
#: settings/serializers/feature.py:106
msgid "day"
msgstr "天"
#: settings/serializers/feature.py:106
msgid "hour"
msgstr "时"

View File

@ -9,7 +9,7 @@ class PermedAssetsWillExpireUserMsg(UserMessage):
def __init__(self, user, assets, day_count=0):
super().__init__(user)
self.assets = assets
self.day_count = _('today') if day_count == 0 else day_count
self.day_count = _('today') if day_count == 0 else day_count + _('day')
def get_html_msg(self) -> dict:
subject = _("You permed assets is about to expire")

View File

@ -5,7 +5,7 @@
<p>
{% blocktranslate %}
The following {{ item_type }} will expire in {{ count }} days
The following {{ item_type }} will expire in {{ count }}
{% endblocktranslate %}
</p>
@ -15,7 +15,7 @@
{% endfor %}
</ul>
<br />
<br/>
-
<p>
{% trans 'If you have any question, please contact the administrator' %}