diff --git a/package-lock.json b/package-lock.json index 85dac096..308c262d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,6 @@ "i18next": "24.1.0", "jotai": "2.10.3", "js-base64": "3.7.7", - "js-yaml": "4.1.0", "jszip": "3.10.1", "react": "18.2.0", "react-dom": "18.2.0", @@ -30,10 +29,11 @@ "semver": "7.7.1" }, "devDependencies": { + "@rollup/plugin-yaml": "^4.1.2", "@tauri-apps/cli": "1.6.3", "npm-run-all": "4.1.5", "sass": "1.79.4", - "source-map": "^0.7.4", + "source-map": "0.7.4", "vite": "6.2.5", "vite-plugin-svgr": "4.3.0" } @@ -1221,6 +1221,28 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@rollup/plugin-yaml": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-yaml/-/plugin-yaml-4.1.2.tgz", + "integrity": "sha512-RpupciIeZMUqhgFE97ba0s98mOFS7CWzN3EJNhJkqSv9XLlWYtwVdtE6cDw6ASOF/sZVFS7kRJXftaqM2Vakdw==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "js-yaml": "^4.1.0", + "tosource": "^2.0.0-alpha.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, "node_modules/@rollup/pluginutils": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.3.tgz", @@ -5353,6 +5375,15 @@ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" }, + "node_modules/tosource": { + "version": "2.0.0-alpha.3", + "resolved": "https://registry.npmjs.org/tosource/-/tosource-2.0.0-alpha.3.tgz", + "integrity": "sha512-KAB2lrSS48y91MzFPFuDg4hLbvDiyTjOVgaK7Erw+5AmZXNq4sFRVn8r6yxSLuNs15PaokrDRpS61ERY9uZOug==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", diff --git a/package.json b/package.json index de100d5d..f9948b13 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "i18next": "24.1.0", "jotai": "2.10.3", "js-base64": "3.7.7", - "js-yaml": "4.1.0", "jszip": "3.10.1", "react": "18.2.0", "react-dom": "18.2.0", @@ -45,6 +44,7 @@ "semver": "7.7.1" }, "devDependencies": { + "@rollup/plugin-yaml": "^4.1.2", "@tauri-apps/cli": "1.6.3", "npm-run-all": "4.1.5", "sass": "1.79.4", diff --git a/src-ui/app/config_page/setting_section/setting_box/plugins/Plugins.jsx b/src-ui/app/config_page/setting_section/setting_box/plugins/Plugins.jsx index b42ea31b..d0715698 100644 --- a/src-ui/app/config_page/setting_section/setting_box/plugins/Plugins.jsx +++ b/src-ui/app/config_page/setting_section/setting_box/plugins/Plugins.jsx @@ -26,7 +26,7 @@ export const Plugins = () => { }; const PluginDownloadContainer = () => { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const { downloadAndExtractPlugin, currentPluginsData, @@ -74,35 +74,49 @@ const PluginDownloadContainer = () => {
Failed to fetch plugins data
} {is_fetching &&Fetching plugins data...
} - {sorted_plugins_data.map((plugin) => ( -- {plugin.is_downloaded - ? plugin.downloaded_plugin_info?.title - : plugin.latest_plugin_info?.title} -
-{plugin.plugin_id}
- {plugin.is_error ? ( -Error: {plugin.error_message}
- ) : ( -- {plugin.is_downloaded - ? `現在のバージョン: ${plugin.downloaded_plugin_info?.plugin_version}` - : null} -
+ {sorted_plugins_data.map((plugin) => { + const target_info = plugin.is_downloaded + ? plugin.downloaded_plugin_info + : plugin.latest_plugin_info; + + const target_locale = target_info.locales && target_info.locales[i18n.language] + ? target_info.locales[i18n.language] + : { + title: target_info.title, + desc: target_info.desc || null, + }; + + return ( ++ {target_locale.title} +
+{plugin.plugin_id}
++ {target_locale.desc} +
+ {plugin.is_error ? ( +Error: {plugin.error_message}
+ ) : ( ++ {plugin.is_downloaded + ? `現在のバージョン: ${plugin.downloaded_plugin_info?.plugin_version}` + : null} +
+