mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
refactor(i18n): use JSON with flattened key and namespace (#30114)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -18,7 +18,7 @@ const nodeDefault: NodeDefault<AnswerNodeType> = {
|
||||
let errorMessages = ''
|
||||
const { answer } = payload
|
||||
if (!answer)
|
||||
errorMessages = t('workflow.errorMsg.fieldRequired', { field: t('workflow.nodes.answer.answer') })
|
||||
errorMessages = t('errorMsg.fieldRequired', { ns: 'workflow', field: t('nodes.answer.answer', { ns: 'workflow' }) })
|
||||
|
||||
return {
|
||||
isValid: !errorMessages,
|
||||
|
||||
@ -15,7 +15,7 @@ const Node: FC<NodeProps<AnswerNodeType>> = ({
|
||||
return (
|
||||
<div className="mb-1 px-3 py-1">
|
||||
<InfoPanel
|
||||
title={t('workflow.nodes.answer.answer')}
|
||||
title={t('nodes.answer.answer', { ns: 'workflow' })}
|
||||
content={(
|
||||
<ReadonlyInputWithSelectVar
|
||||
value={data.answer}
|
||||
|
||||
@ -7,7 +7,7 @@ import Editor from '@/app/components/workflow/nodes/_base/components/prompt/edit
|
||||
import useAvailableVarList from '@/app/components/workflow/nodes/_base/hooks/use-available-var-list'
|
||||
import useConfig from './use-config'
|
||||
|
||||
const i18nPrefix = 'workflow.nodes.answer'
|
||||
const i18nPrefix = 'nodes.answer'
|
||||
|
||||
const Panel: FC<NodePanelProps<AnswerNodeType>> = ({
|
||||
id,
|
||||
@ -34,7 +34,7 @@ const Panel: FC<NodePanelProps<AnswerNodeType>> = ({
|
||||
<Editor
|
||||
readOnly={readOnly}
|
||||
justVar
|
||||
title={t(`${i18nPrefix}.answer`)!}
|
||||
title={t(`${i18nPrefix}.answer`, { ns: 'workflow' })!}
|
||||
value={inputs.answer}
|
||||
onChange={handleAnswerChange}
|
||||
nodesOutputVars={availableVars}
|
||||
|
||||
Reference in New Issue
Block a user