mirror of https://github.com/langgenius/dify.git
feat: agent checklist i18n
This commit is contained in:
parent
1b8ec6710a
commit
c1ae681b6c
|
|
@ -67,6 +67,7 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => {
|
|||
moreDataForCheckValid = {
|
||||
provider,
|
||||
strategy,
|
||||
language,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,19 +19,20 @@ const nodeDefault: NodeDefault<AgentNodeType> = {
|
|||
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] }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -747,6 +747,9 @@ const translation = {
|
|||
json: 'agent generated json',
|
||||
},
|
||||
},
|
||||
checkList: {
|
||||
strategyNotSelected: 'Strategy not selected',
|
||||
},
|
||||
},
|
||||
tracing: {
|
||||
stopBy: 'Stop by {{user}}',
|
||||
|
|
|
|||
|
|
@ -746,6 +746,9 @@ const translation = {
|
|||
},
|
||||
json: 'agent 生成的json',
|
||||
},
|
||||
checkList: {
|
||||
strategyNotSelected: '未选择策略',
|
||||
},
|
||||
},
|
||||
},
|
||||
tracing: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue