mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-15 04:44:12 +00:00
* fix: 修改翻译 * fix: 修改保存数据库翻译 * fix: 修复翻译为none问题 Co-authored-by: feng626 <1304903146@qq.com> Co-authored-by: Jiangjie.Bai <32935519+BaiJiangJie@users.noreply.github.com>
15 lines
317 B
Python
15 lines
317 B
Python
from django.utils.translation import gettext
|
|
|
|
|
|
def translate_value(value):
|
|
if not value:
|
|
return value
|
|
sps = ['. ', ': ']
|
|
spb = {str(sp in value): sp for sp in sps}
|
|
sp = spb.get('True')
|
|
if not sp:
|
|
return value
|
|
|
|
tpl, data = value.split(sp, 1)
|
|
return gettext(tpl + sp) + data
|