mirror of https://github.com/jumpserver/jumpserver
perf: 修改支持 i18n
parent
f496f7d635
commit
be58539df8
|
@ -1,12 +1,12 @@
|
|||
import io
|
||||
|
||||
import yaml
|
||||
from django.utils.translation import get_language
|
||||
from django.conf import settings
|
||||
from jinja2 import Environment
|
||||
|
||||
|
||||
def translate(i18n, key):
|
||||
lang = get_language()[:2]
|
||||
lang = settings.LANGUAGE_CODE[:2]
|
||||
lang_data = i18n.get(key, {})
|
||||
return lang_data.get(lang, key)
|
||||
|
||||
|
|
|
@ -146,6 +146,8 @@ only_system_permissions = (
|
|||
('authentication', '*', '*', '*'),
|
||||
('tickets', '*', '*', '*'),
|
||||
('orgs', 'organization', 'view', 'rootorg'),
|
||||
('terminal', 'applet', '*', '*'),
|
||||
('terminal', 'applethost', '*', '*'),
|
||||
)
|
||||
|
||||
only_org_permissions = (
|
||||
|
|
Loading…
Reference in New Issue