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

View File

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

View File

@ -9,7 +9,7 @@ class PermedAssetsWillExpireUserMsg(UserMessage):
def __init__(self, user, assets, day_count=0): def __init__(self, user, assets, day_count=0):
super().__init__(user) super().__init__(user)
self.assets = assets 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: def get_html_msg(self) -> dict:
subject = _("You permed assets is about to expire") subject = _("You permed assets is about to expire")

View File

@ -5,7 +5,7 @@
<p> <p>
{% blocktranslate %} {% blocktranslate %}
The following {{ item_type }} will expire in {{ count }} days The following {{ item_type }} will expire in {{ count }}
{% endblocktranslate %} {% endblocktranslate %}
</p> </p>