mirror of https://github.com/jumpserver/jumpserver
fix: 远程应用README国际化
parent
d4e53be7ce
commit
c4342567ba
|
@ -119,8 +119,7 @@ class AppletViewSet(DownloadUploadMixin, JMSBulkModelViewSet):
|
|||
return queryset
|
||||
|
||||
@staticmethod
|
||||
def read_manifest_with_i18n(obj):
|
||||
lang = get_language()
|
||||
def read_manifest_with_i18n(obj, lang='zh'):
|
||||
with open(os.path.join(obj.path, 'manifest.yml'), encoding='utf8') as f:
|
||||
manifest = yaml_load_with_i18n(f, lang)
|
||||
return manifest
|
||||
|
@ -130,10 +129,21 @@ class AppletViewSet(DownloadUploadMixin, JMSBulkModelViewSet):
|
|||
self.trans_object(obj)
|
||||
return queryset
|
||||
|
||||
@staticmethod
|
||||
def readme(obj, lang=''):
|
||||
lang = lang[:2]
|
||||
readme_file = os.path.join(obj.path, f'README_{lang.upper()}.md')
|
||||
if os.path.isfile(readme_file):
|
||||
with open(readme_file, 'r') as f:
|
||||
return f.read()
|
||||
return ''
|
||||
|
||||
def trans_object(self, obj):
|
||||
manifest = self.read_manifest_with_i18n(obj)
|
||||
lang = get_language()
|
||||
manifest = self.read_manifest_with_i18n(obj, lang)
|
||||
obj.display_name = manifest.get('display_name', obj.display_name)
|
||||
obj.comment = manifest.get('comment', obj.comment)
|
||||
obj.readme = self.readme(obj, lang)
|
||||
return obj
|
||||
|
||||
def is_record_found(self, obj, search):
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
## Selenium Version
|
||||
|
||||
- Selenium == 4.4.0
|
||||
- Chrome and ChromeDriver versions must match
|
||||
- Driver [download address](https://chromedriver.chromium.org/downloads)
|
||||
|
||||
## ChangeLog
|
||||
|
||||
Refer to [ChangeLog](./ChangeLog) for some important updates.
|
|
@ -0,0 +1,9 @@
|
|||
## Selenium バージョン
|
||||
|
||||
- Selenium == 4.4.0
|
||||
- Chrome と ChromeDriver のバージョンは一致している必要があります
|
||||
- ドライバ [ダウンロードアドレス](https://chromedriver.chromium.org/downloads)
|
||||
|
||||
## 変更ログ
|
||||
|
||||
重要な更新については、[変更ログ](./ChangeLog) を参照してください
|
|
@ -0,0 +1,4 @@
|
|||
## DBeaver
|
||||
|
||||
- When connecting to a database application, it is necessary to download the driver. You can either install it offline
|
||||
in advance or install the corresponding driver as prompted when connecting.
|
|
@ -0,0 +1,3 @@
|
|||
## DBeaver
|
||||
|
||||
- データベースに接続する際には、ドライバをダウンロードする必要があります。事前にオフラインでインストールするか、接続時に表示される指示に従って該当するドライバをインストールしてください。
|
Loading…
Reference in New Issue