diff --git a/apps/terminal/api/applet/applet.py b/apps/terminal/api/applet/applet.py index f85e5f572..de725c332 100644 --- a/apps/terminal/api/applet/applet.py +++ b/apps/terminal/api/applet/applet.py @@ -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): diff --git a/apps/terminal/applets/chrome/README_EN.md b/apps/terminal/applets/chrome/README_EN.md new file mode 100644 index 000000000..05240f598 --- /dev/null +++ b/apps/terminal/applets/chrome/README_EN.md @@ -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. diff --git a/apps/terminal/applets/chrome/README_JA.md b/apps/terminal/applets/chrome/README_JA.md new file mode 100644 index 000000000..26336c9ba --- /dev/null +++ b/apps/terminal/applets/chrome/README_JA.md @@ -0,0 +1,9 @@ +## Selenium バージョン + +- Selenium == 4.4.0 +- Chrome と ChromeDriver のバージョンは一致している必要があります +- ドライバ [ダウンロードアドレス](https://chromedriver.chromium.org/downloads) + +## 変更ログ + +重要な更新については、[変更ログ](./ChangeLog) を参照してください diff --git a/apps/terminal/applets/chrome/README.md b/apps/terminal/applets/chrome/README_ZH.md similarity index 100% rename from apps/terminal/applets/chrome/README.md rename to apps/terminal/applets/chrome/README_ZH.md diff --git a/apps/terminal/applets/dbeaver/README_EN.md b/apps/terminal/applets/dbeaver/README_EN.md new file mode 100644 index 000000000..cc4165853 --- /dev/null +++ b/apps/terminal/applets/dbeaver/README_EN.md @@ -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. diff --git a/apps/terminal/applets/dbeaver/README_JA.md b/apps/terminal/applets/dbeaver/README_JA.md new file mode 100644 index 000000000..5f2cd55ce --- /dev/null +++ b/apps/terminal/applets/dbeaver/README_JA.md @@ -0,0 +1,3 @@ +## DBeaver + +- データベースに接続する際には、ドライバをダウンロードする必要があります。事前にオフラインでインストールするか、接続時に表示される指示に従って該当するドライバをインストールしてください。 diff --git a/apps/terminal/applets/dbeaver/README.md b/apps/terminal/applets/dbeaver/README_ZH.md similarity index 100% rename from apps/terminal/applets/dbeaver/README.md rename to apps/terminal/applets/dbeaver/README_ZH.md