diff --git a/web/app/components/workflow/hooks/use-checklist.ts b/web/app/components/workflow/hooks/use-checklist.ts index a018ce7cfe..9646b0da87 100644 --- a/web/app/components/workflow/hooks/use-checklist.ts +++ b/web/app/components/workflow/hooks/use-checklist.ts @@ -67,6 +67,7 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => { moreDataForCheckValid = { provider, strategy, + language, } } diff --git a/web/app/components/workflow/nodes/agent/default.ts b/web/app/components/workflow/nodes/agent/default.ts index d7caba3b72..3de738ee0a 100644 --- a/web/app/components/workflow/nodes/agent/default.ts +++ b/web/app/components/workflow/nodes/agent/default.ts @@ -19,19 +19,20 @@ const nodeDefault: NodeDefault = { checkValid(payload, t, moreDataForCheckValid: { strategyProvider: StrategyPluginDetail | undefined, strategy: StrategyDetail | undefined + language: string }) { - const { strategy } = moreDataForCheckValid + const { strategy, language } = moreDataForCheckValid if (!strategy) { return { isValid: false, - errorMessage: 'Please select a strategy', + errorMessage: t('workflow.checkList.strategyNotSelected'), } } for (const param of strategy.parameters) { if (param.required && !payload.agent_parameters?.[param.name]?.value) { return { isValid: false, - errorMessage: `Please select ${param.name}`, + errorMessage: t('workflow.errorMsg.fieldRequired', { field: param.label[language] }), } } } diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts index 5b5df3843e..583d30f2c1 100644 --- a/web/i18n/en-US/workflow.ts +++ b/web/i18n/en-US/workflow.ts @@ -747,6 +747,9 @@ const translation = { json: 'agent generated json', }, }, + checkList: { + strategyNotSelected: 'Strategy not selected', + }, }, tracing: { stopBy: 'Stop by {{user}}', diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts index a86c746b3e..57b53d0644 100644 --- a/web/i18n/zh-Hans/workflow.ts +++ b/web/i18n/zh-Hans/workflow.ts @@ -746,6 +746,9 @@ const translation = { }, json: 'agent 生成的json', }, + checkList: { + strategyNotSelected: '未选择策略', + }, }, }, tracing: {