mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
317 B
15 lines
317 B
3 years ago
|
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
|