diff --git a/templates/metadata/pipeline/ai.yaml b/templates/metadata/pipeline/ai.yaml
index 4f25a263..4e5585bb 100644
--- a/templates/metadata/pipeline/ai.yaml
+++ b/templates/metadata/pipeline/ai.yaml
@@ -21,7 +21,7 @@ stages:
options:
- name: local-agent
label:
- en_US: Embedded Agent
+ en_US: Local Agent
zh_Hans: 内置 Agent
- name: dify-service-api
label:
@@ -33,7 +33,7 @@ stages:
zh_Hans: 阿里云百炼平台 API
- name: local-agent
label:
- en_US: Embedded Agent
+ en_US: Local Agent
zh_Hans: 内置 Agent
description:
en_US: Configure the embedded agent of the pipeline
diff --git a/web/src/app/home/plugins/plugin-installed/plugin-card/PluginCardComponent.tsx b/web/src/app/home/plugins/plugin-installed/plugin-card/PluginCardComponent.tsx
index eecba2f0..119a82bb 100644
--- a/web/src/app/home/plugins/plugin-installed/plugin-card/PluginCardComponent.tsx
+++ b/web/src/app/home/plugins/plugin-installed/plugin-card/PluginCardComponent.tsx
@@ -4,6 +4,7 @@ import { httpClient } from '@/app/infra/http/HttpClient';
import { Badge } from '@/components/ui/badge';
import { Switch } from '@/components/ui/switch';
import { toast } from 'sonner';
+import { useTranslation } from 'react-i18next';
export default function PluginCardComponent({
cardVO,
@@ -12,6 +13,7 @@ export default function PluginCardComponent({
cardVO: PluginCardVO;
onCardClick: () => void;
}) {
+ const { t } = useTranslation();
const [enabled, setEnabled] = useState(cardVO.enabled);
const [switchEnable, setSwitchEnable] = useState(true);
@@ -24,7 +26,7 @@ export default function PluginCardComponent({
setEnabled(!enabled);
})
.catch((err) => {
- toast.error('修改失败:' + err.message);
+ toast.error(t('plugins.modifyFailed') + err.message);
})
.finally(() => {
setSwitchEnable(true);
@@ -75,7 +77,9 @@ export default function PluginCardComponent({
- 事件 {Object.keys(cardVO.event_handlers).length}
+ {t('plugins.eventCount', {
+ count: Object.keys(cardVO.event_handlers).length,
+ })}
@@ -89,7 +93,7 @@ export default function PluginCardComponent({
- 工具 {cardVO.tools.length}
+ {t('plugins.toolCount', { count: cardVO.tools.length })}
diff --git a/web/src/app/home/plugins/plugin-installed/plugin-form/PluginForm.tsx b/web/src/app/home/plugins/plugin-installed/plugin-form/PluginForm.tsx
index beadb27a..35e8be8a 100644
--- a/web/src/app/home/plugins/plugin-installed/plugin-form/PluginForm.tsx
+++ b/web/src/app/home/plugins/plugin-installed/plugin-form/PluginForm.tsx
@@ -13,6 +13,7 @@ import {
} from '@/components/ui/dialog';
import { toast } from 'sonner';
import { i18nObj } from '@/i18n/I18nProvider';
+import { useTranslation } from 'react-i18next';
enum PluginRemoveStatus {
WAIT_INPUT = 'WAIT_INPUT',
@@ -31,6 +32,7 @@ export default function PluginForm({
onFormSubmit: () => void;
onFormCancel: () => void;
}) {
+ const { t } = useTranslation();
const [pluginInfo, setPluginInfo] = useState();
const [pluginConfig, setPluginConfig] = useState();
const [isSaving, setIsLoading] = useState(false);
@@ -117,20 +119,23 @@ export default function PluginForm({
>
- 删除确认
+ {t('plugins.deleteConfirm')}
{pluginRemoveStatus === PluginRemoveStatus.WAIT_INPUT && (
- 你确定要删除插件({pluginAuthor}/{pluginName})吗?
+ {t('plugins.confirmDeletePlugin', {
+ author: pluginAuthor,
+ name: pluginName,
+ })}
)}
{pluginRemoveStatus === PluginRemoveStatus.REMOVING && (
- 删除中...
+ {t('plugins.deleting')}
)}
{pluginRemoveStatus === PluginRemoveStatus.ERROR && (
- 删除失败:
+ {t('plugins.deleteError')}
{pluginRemoveError}
)}
@@ -144,7 +149,7 @@ export default function PluginForm({
setPluginRemoveStatus(PluginRemoveStatus.WAIT_INPUT);
}}
>
- 取消
+ {t('plugins.cancel')}
)}
{pluginRemoveStatus === PluginRemoveStatus.WAIT_INPUT && (
@@ -154,12 +159,12 @@ export default function PluginForm({
deletePlugin();
}}
>
- 确认删除
+ {t('plugins.confirmDelete')}
)}
{pluginRemoveStatus === PluginRemoveStatus.REMOVING && (
)}
{pluginRemoveStatus === PluginRemoveStatus.ERROR && (
@@ -170,7 +175,7 @@ export default function PluginForm({
// setPluginRemoveStatus(PluginRemoveStatus.WAIT_INPUT);
}}
>
- 关闭
+ {t('plugins.close')}
)}
@@ -199,7 +204,9 @@ export default function PluginForm({
/>
)}
{pluginInfo.config_schema.length === 0 && (
- 该插件没有配置项。
+
+ {t('plugins.pluginNoConfig')}
+
)}
@@ -214,8 +221,8 @@ export default function PluginForm({
disabled={pluginRemoveStatus === PluginRemoveStatus.REMOVING}
>
{pluginRemoveStatus === PluginRemoveStatus.REMOVING
- ? '删除中...'
- : '删除插件'}
+ ? t('plugins.deleting')
+ : t('plugins.deletePlugin')}
diff --git a/web/src/app/home/plugins/plugin-market/plugin-market-card/PluginMarketCardComponent.tsx b/web/src/app/home/plugins/plugin-market/plugin-market-card/PluginMarketCardComponent.tsx
index 990701f0..bd62cdec 100644
--- a/web/src/app/home/plugins/plugin-market/plugin-market-card/PluginMarketCardComponent.tsx
+++ b/web/src/app/home/plugins/plugin-market/plugin-market-card/PluginMarketCardComponent.tsx
@@ -1,5 +1,6 @@
import { PluginMarketCardVO } from '@/app/home/plugins/plugin-market/plugin-market-card/PluginMarketCardVO';
import { Button } from '@/components/ui/button';
+import { useTranslation } from 'react-i18next';
export default function PluginMarketCardComponent({
cardVO,
@@ -8,6 +9,8 @@ export default function PluginMarketCardComponent({
cardVO: PluginMarketCardVO;
installPlugin: (pluginURL: string) => void;
}) {
+ const { t } = useTranslation();
+
function handleInstallClick(pluginURL: string) {
installPlugin(pluginURL);
}
@@ -51,7 +54,7 @@ export default function PluginMarketCardComponent({
- 星标 {cardVO.starCount}
+ {t('plugins.starCount', { count: cardVO.starCount })}
@@ -73,7 +76,7 @@ export default function PluginMarketCardComponent({
}}
className="cursor-pointer"
>
- 安装
+ {t('plugins.install')}
diff --git a/web/src/i18n/locales/en-US.ts b/web/src/i18n/locales/en-US.ts
index d7a50b35..8a603a60 100644
--- a/web/src/i18n/locales/en-US.ts
+++ b/web/src/i18n/locales/en-US.ts
@@ -142,6 +142,22 @@ const enUS = {
'Plugin order affects the processing order within the same event, please drag the plugin card to sort',
pluginSortSuccess: 'Plugin sort successful',
pluginSortError: 'Plugin sort failed: ',
+ pluginNoConfig: 'The plugin has no configuration items.',
+ deleting: 'Deleting...',
+ deletePlugin: 'Delete Plugin',
+ cancel: 'Cancel',
+ saveConfig: 'Save Config',
+ saving: 'Saving...',
+ confirmDeletePlugin:
+ 'Are you sure you want to delete the plugin ({{author}}/{{name}})?',
+ confirmDelete: 'Confirm Delete',
+ deleteError: 'Delete failed: ',
+ close: 'Close',
+ deleteConfirm: 'Delete Confirmation',
+ modifyFailed: 'Modify failed: ',
+ eventCount: 'Events: {{count}}',
+ toolCount: 'Tools: {{count}}',
+ starCount: 'Stars: {{count}}',
},
pipelines: {
title: 'Pipelines',
diff --git a/web/src/i18n/locales/zh-Hans.ts b/web/src/i18n/locales/zh-Hans.ts
index b368043f..aeb5a2d8 100644
--- a/web/src/i18n/locales/zh-Hans.ts
+++ b/web/src/i18n/locales/zh-Hans.ts
@@ -138,6 +138,20 @@ const zhHans = {
'插件顺序会影响同一事件内的处理顺序,请拖动插件卡片排序',
pluginSortSuccess: '插件排序成功',
pluginSortError: '插件排序失败:',
+ pluginNoConfig: '插件没有配置项。',
+ deleting: '删除中...',
+ deletePlugin: '删除插件',
+ saveConfig: '保存配置',
+ saving: '保存中...',
+ confirmDeletePlugin: '你确定要删除插件({{author}}/{{name}})吗?',
+ confirmDelete: '确认删除',
+ deleteError: '删除失败:',
+ close: '关闭',
+ deleteConfirm: '删除确认',
+ modifyFailed: '修改失败:',
+ eventCount: '事件:{{count}}',
+ toolCount: '工具:{{count}}',
+ starCount: '星标:{{count}}',
},
pipelines: {
title: '流水线',