mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-24 13:00:26 +00:00
Merge pull request #10267 from jumpserver/pr@dev@perf_yaml_support_i18n
perf: yaml 文件支持 i18n
This commit is contained in:
@@ -2,7 +2,7 @@ import json
|
||||
import os
|
||||
from functools import partial
|
||||
|
||||
import yaml
|
||||
from common.utils.yml import yaml_load_with_i18n
|
||||
|
||||
|
||||
def check_platform_method(manifest, manifest_path):
|
||||
@@ -40,7 +40,8 @@ def get_platform_automation_methods(path):
|
||||
continue
|
||||
|
||||
with open(path, 'r') as f:
|
||||
manifest = yaml.safe_load(f)
|
||||
print("path: ", path)
|
||||
manifest = yaml_load_with_i18n(f)
|
||||
check_platform_method(manifest, path)
|
||||
manifest['dir'] = os.path.dirname(path)
|
||||
manifest['params_serializer'] = generate_serializer(manifest)
|
||||
|
@@ -1,7 +1,13 @@
|
||||
id: posix_ping
|
||||
name: Posix ping
|
||||
name: "{{ 'Posix ping' | trans }}"
|
||||
category: host
|
||||
type:
|
||||
- linux
|
||||
- unix
|
||||
method: ping
|
||||
|
||||
i18n:
|
||||
Posix ping:
|
||||
zh: Posix ping
|
||||
en: Posix ping
|
||||
ja: Posix ピング
|
||||
|
Reference in New Issue
Block a user