mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-16 07:18:22 +00:00
fix: 修改翻译 (#7526)
* fix: 修改翻译 * fix: 修改保存数据库翻译 * fix: 修复翻译为none问题 Co-authored-by: feng626 <1304903146@qq.com> Co-authored-by: Jiangjie.Bai <32935519+BaiJiangJie@users.noreply.github.com>
This commit is contained in:
@@ -12,6 +12,7 @@ from django.utils import timezone
|
||||
from django.utils.translation import ugettext_lazy as _, gettext
|
||||
|
||||
from common.utils import get_logger, lazyproperty
|
||||
from common.utils.translate import translate_value
|
||||
from common.fields.model import (
|
||||
JsonListTextField, JsonDictCharField, EncryptJsonDictCharField,
|
||||
JsonDictTextField,
|
||||
@@ -60,14 +61,8 @@ class Task(PeriodTaskModelMixin, OrgModelMixin):
|
||||
|
||||
@lazyproperty
|
||||
def display_name(self):
|
||||
sps = ['. ', ': ']
|
||||
spb = {str(sp in self.name): sp for sp in sps}
|
||||
sp = spb.get('True')
|
||||
if not sp:
|
||||
return self.name
|
||||
|
||||
tpl, data = self.name.split(sp, 1)
|
||||
return gettext(tpl + sp) + data
|
||||
value = translate_value(self.name)
|
||||
return value
|
||||
|
||||
@property
|
||||
def timedelta(self):
|
||||
|
Reference in New Issue
Block a user