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:
Stephen Zhou
2025-12-29 14:52:32 +08:00
committed by GitHub
parent 09be869f58
commit 6d0e36479b
2552 changed files with 111159 additions and 142972 deletions

View File

@ -20,7 +20,7 @@ export const AddVariablePopup = ({
return (
<div className="w-[240px] rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg">
<div className="flex h-[34px] items-center border-b-[0.5px] border-b-divider-regular px-4 text-[13px] font-semibold text-text-secondary">
{t('workflow.nodes.variableAssigner.setAssignVariable')}
{t('nodes.variableAssigner.setAssignVariable', { ns: 'workflow' })}
</div>
<div className="p-1">
<VarReferenceVars

View File

@ -46,7 +46,7 @@ const NotFoundWarn = (props: {
</p>
<p>
<Link href="/plugins" className="tracking-tight text-text-accent">
{t('workflow.nodes.agent.linkToPlugin')}
{t('nodes.agent.linkToPlugin', { ns: 'workflow' })}
</Link>
</p>
</div>
@ -174,7 +174,7 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) =>
<p
className={cn(value ? 'text-components-input-text-filled' : 'text-components-input-text-placeholder', 'px-1 text-xs')}
>
{value?.agent_strategy_label || t('workflow.nodes.agent.strategy.selectTip')}
{value?.agent_strategy_label || t('nodes.agent.strategy.selectTip', { ns: 'workflow' })}
</p>
<div className="ml-auto flex items-center gap-1">
{showInstallButton && value && (
@ -187,15 +187,15 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) =>
{showPluginNotInstalledWarn
? (
<NotFoundWarn
title={t('workflow.nodes.agent.pluginNotInstalled')}
description={t('workflow.nodes.agent.pluginNotInstalledDesc')}
title={t('nodes.agent.pluginNotInstalled', { ns: 'workflow' })}
description={t('nodes.agent.pluginNotInstalledDesc', { ns: 'workflow' })}
/>
)
: showUnsupportedStrategy
? (
<NotFoundWarn
title={t('workflow.nodes.agent.unsupportedStrategy')}
description={t('workflow.nodes.agent.strategyNotFoundDesc')}
title={t('nodes.agent.unsupportedStrategy', { ns: 'workflow' })}
description={t('nodes.agent.strategyNotFoundDesc', { ns: 'workflow' })}
/>
)
: <RiArrowDownSLine className="size-4 text-text-tertiary" />}
@ -204,9 +204,9 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) =>
uniqueIdentifier={value.plugin_unique_identifier}
tooltip={(
<ToolTipContent
title={t('workflow.nodes.agent.unsupportedStrategy')}
title={t('nodes.agent.unsupportedStrategy', { ns: 'workflow' })}
>
{t('workflow.nodes.agent.strategyNotFoundDescAndSwitchVersion')}
{t('nodes.agent.strategyNotFoundDescAndSwitchVersion', { ns: 'workflow' })}
</ToolTipContent>
)}
onChange={() => {
@ -220,7 +220,7 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) =>
<PortalToFollowElemContent className="z-10">
<div className="w-[388px] overflow-hidden rounded-md border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow">
<header className="flex gap-1 p-2">
<SearchInput placeholder={t('workflow.nodes.agent.strategy.searchPlaceholder')} value={query} onChange={setQuery} className="w-full" />
<SearchInput placeholder={t('nodes.agent.strategy.searchPlaceholder', { ns: 'workflow' })} value={query} onChange={setQuery} className="w-full" />
<ViewTypeSelect viewType={viewType} onChange={setViewType} />
</header>
<main className="relative flex w-full flex-col overflow-hidden md:max-h-[300px] xl:max-h-[400px] 2xl:max-h-[564px]" ref={wrapElemRef}>

View File

@ -248,10 +248,10 @@ export const AgentStrategy = memo((props: AgentStrategyProps) => {
: (
<ListEmpty
icon={<Agent className="h-5 w-5 shrink-0 text-text-accent" />}
title={t('workflow.nodes.agent.strategy.configureTip')}
title={t('nodes.agent.strategy.configureTip', { ns: 'workflow' })}
description={(
<div className="text-xs text-text-tertiary">
{t('workflow.nodes.agent.strategy.configureTipDesc')}
{t('nodes.agent.strategy.configureTipDesc', { ns: 'workflow' })}
{' '}
<br />
<Link
@ -262,7 +262,7 @@ export const AgentStrategy = memo((props: AgentStrategyProps) => {
className="text-text-accent-secondary"
target="_blank"
>
{t('workflow.nodes.agent.learnMore')}
{t('nodes.agent.learnMore', { ns: 'workflow' })}
</Link>
</div>
)}

View File

@ -31,7 +31,7 @@ const BoolInput: FC<Props> = ({
/>
<div className="system-sm-medium flex items-center gap-1 text-text-secondary">
{name}
{!required && <span className="system-xs-regular text-text-tertiary">{t('workflow.panel.optional')}</span>}
{!required && <span className="system-xs-regular text-text-tertiary">{t('panel.optional', { ns: 'workflow' })}</span>}
</div>
</div>
)

View File

@ -125,13 +125,13 @@ const FormItem: FC<Props> = ({
{payload.hide === true
? (
<span className="system-xs-regular text-text-tertiary">
{t('workflow.panel.optional_and_hidden')}
{t('panel.optional_and_hidden', { ns: 'workflow' })}
</span>
)
: (
!payload.required && (
<span className="system-xs-regular text-text-tertiary">
{t('workflow.panel.optional')}
{t('panel.optional', { ns: 'workflow' })}
</span>
)
)}
@ -323,7 +323,7 @@ const FormItem: FC<Props> = ({
value={item}
title={(
<span>
{t('appDebug.variableConfig.content')}
{t('variableConfig.content', { ns: 'appDebug' })}
{' '}
{index + 1}
{' '}

View File

@ -17,7 +17,7 @@ import { cn } from '@/utils/classnames'
import Form from './form'
import PanelWrap from './panel-wrap'
const i18nPrefix = 'workflow.singleRun'
const i18nPrefix = 'singleRun'
export type BeforeRunFormProps = {
nodeName: string
@ -92,7 +92,7 @@ const BeforeRunForm: FC<BeforeRunFormProps> = ({
form.inputs.forEach((input) => {
const value = form.values[input.variable] as any
if (!errMsg && input.required && (input.type !== InputVarType.checkbox) && !(input.variable in existVarValuesInForm) && (value === '' || value === undefined || value === null || (input.type === InputVarType.files && value.length === 0)))
errMsg = t('workflow.errorMsg.fieldRequired', { field: typeof input.label === 'object' ? input.label.variable : input.label })
errMsg = t('errorMsg.fieldRequired', { ns: 'workflow', field: typeof input.label === 'object' ? input.label.variable : input.label })
if (!errMsg && (input.type === InputVarType.singleFile || input.type === InputVarType.multiFiles) && value) {
let fileIsUploading = false
@ -102,7 +102,7 @@ const BeforeRunForm: FC<BeforeRunFormProps> = ({
fileIsUploading = value.transferMethod === TransferMethod.local_file && !value.uploadedId
if (fileIsUploading)
errMsg = t('appDebug.errorMessage.waitForFileUpload')
errMsg = t('errorMessage.waitForFileUpload', { ns: 'appDebug' })
}
})
})
@ -129,7 +129,7 @@ const BeforeRunForm: FC<BeforeRunFormProps> = ({
})
if (parseErrorJsonField) {
Toast.notify({
message: t('workflow.errorMsg.invalidJson', { field: parseErrorJsonField }),
message: t('errorMsg.invalidJson', { ns: 'workflow', field: parseErrorJsonField }),
type: 'error',
})
return
@ -170,7 +170,7 @@ const BeforeRunForm: FC<BeforeRunFormProps> = ({
</div>
<div className="mt-4 flex justify-between space-x-2 px-4">
<Button disabled={!isFileLoaded} variant="primary" className="w-0 grow space-x-2" onClick={handleRun}>
<div>{t(`${i18nPrefix}.startRun`)}</div>
<div>{t(`${i18nPrefix}.startRun`, { ns: 'workflow' })}</div>
</Button>
</div>
</div>

View File

@ -6,7 +6,7 @@ import {
import * as React from 'react'
import { useTranslation } from 'react-i18next'
const i18nPrefix = 'workflow.singleRun'
const i18nPrefix = 'singleRun'
export type Props = {
nodeName: string
@ -25,7 +25,7 @@ const PanelWrap: FC<Props> = ({
<div className="flex h-full flex-col rounded-2xl bg-components-panel-bg">
<div className="flex h-8 shrink-0 items-center justify-between pl-4 pr-3 pt-3">
<div className="truncate text-base font-semibold text-text-primary">
{t(`${i18nPrefix}.testRun`)}
{t(`${i18nPrefix}.testRun`, { ns: 'workflow' })}
{' '}
{nodeName}
</div>

View File

@ -13,7 +13,7 @@ import { VarType } from '@/app/components/workflow/types'
import { Resolution } from '@/types/app'
import VarReferencePicker from './variable/var-reference-picker'
const i18nPrefix = 'workflow.nodes.llm'
const i18nPrefix = 'nodes.llm'
type Props = {
isVisionModel: boolean
@ -58,11 +58,11 @@ const ConfigVision: FC<Props> = ({
return (
<Field
title={t(`${i18nPrefix}.vision`)}
tooltip={t('appDebug.vision.description')!}
title={t(`${i18nPrefix}.vision`, { ns: 'workflow' })}
tooltip={t('vision.description', { ns: 'appDebug' })!}
operations={(
<Tooltip
popupContent={t('appDebug.vision.onlySupportVisionModelTip')!}
popupContent={t('vision.onlySupportVisionModelTip', { ns: 'appDebug' })!}
disabled={isVisionModel}
>
<Switch disabled={readOnly || !isVisionModel} size="md" defaultValue={!isVisionModel ? false : enabled} onChange={onEnabledChange} />

View File

@ -145,7 +145,7 @@ const CodeEditor: FC<Props> = ({
<Editor
{...editorProps}
onMount={onEditorMounted}
placeholder={t('workflow.common.jinjaEditorPlaceholder')!}
placeholder={t('common.jinjaEditorPlaceholder', { ns: 'workflow' })!}
/>
{isShowVarPicker && (
<div

View File

@ -22,7 +22,7 @@ const EntryNodeContainer: FC<EntryNodeContainerProps> = ({
const label = useMemo(() => {
const translationKey = nodeType === StartNodeTypeEnum.Start ? 'entryNodeStatus' : 'triggerStatus'
return customLabel || t(`workflow.${translationKey}.enabled`)
return customLabel || t(`${translationKey}.enabled`, { ns: 'workflow' })
}, [customLabel, nodeType, t])
return (

View File

@ -33,7 +33,7 @@ const DefaultValue = ({
return (
<div className="px-4 pt-2">
<div className="body-xs-regular mb-2 text-text-tertiary">
{t('workflow.nodes.common.errorHandle.defaultValue.desc')}
{t('nodes.common.errorHandle.defaultValue.desc', { ns: 'workflow' })}
&nbsp;
<a
href={docLink('/guides/workflow/error-handling/README', {
@ -42,7 +42,7 @@ const DefaultValue = ({
target="_blank"
className="text-text-accent"
>
{t('workflow.common.learnMore')}
{t('common.learnMore', { ns: 'workflow' })}
</a>
</div>
<div className="space-y-1">

View File

@ -32,7 +32,7 @@ const ErrorHandleOnNode = ({
)}
>
<div className="system-xs-medium-uppercase text-text-tertiary">
{t('workflow.common.onFailure')}
{t('common.onFailure', { ns: 'workflow' })}
</div>
<div className={cn(
'system-xs-medium text-text-secondary',
@ -41,12 +41,12 @@ const ErrorHandleOnNode = ({
>
{
error_strategy === ErrorHandleTypeEnum.defaultValue && (
t('workflow.nodes.common.errorHandle.defaultValue.output')
t('nodes.common.errorHandle.defaultValue.output', { ns: 'workflow' })
)
}
{
error_strategy === ErrorHandleTypeEnum.failBranch && (
t('workflow.nodes.common.errorHandle.failBranch.title')
t('nodes.common.errorHandle.failBranch.title', { ns: 'workflow' })
)
}
</div>

View File

@ -55,9 +55,9 @@ const ErrorHandle = ({
<div className="flex grow items-center justify-between pr-4">
<div className="flex items-center">
<div className="system-sm-semibold-uppercase mr-0.5 text-text-secondary">
{t('workflow.nodes.common.errorHandle.title')}
{t('nodes.common.errorHandle.title', { ns: 'workflow' })}
</div>
<Tooltip popupContent={t('workflow.nodes.common.errorHandle.tip')} />
<Tooltip popupContent={t('nodes.common.errorHandle.tip', { ns: 'workflow' })} />
{collapseIcon}
</div>
<ErrorHandleTypeSelector

View File

@ -13,10 +13,10 @@ const ErrorHandleTip = ({
const text = useMemo(() => {
if (type === ErrorHandleTypeEnum.failBranch)
return t('workflow.nodes.common.errorHandle.failBranch.inLog')
return t('nodes.common.errorHandle.failBranch.inLog', { ns: 'workflow' })
if (type === ErrorHandleTypeEnum.defaultValue)
return t('workflow.nodes.common.errorHandle.defaultValue.inLog')
return t('nodes.common.errorHandle.defaultValue.inLog', { ns: 'workflow' })
}, [t, type])
if (!type)

View File

@ -25,18 +25,18 @@ const ErrorHandleTypeSelector = ({
const options = [
{
value: ErrorHandleTypeEnum.none,
label: t('workflow.nodes.common.errorHandle.none.title'),
description: t('workflow.nodes.common.errorHandle.none.desc'),
label: t('nodes.common.errorHandle.none.title', { ns: 'workflow' }),
description: t('nodes.common.errorHandle.none.desc', { ns: 'workflow' }),
},
{
value: ErrorHandleTypeEnum.defaultValue,
label: t('workflow.nodes.common.errorHandle.defaultValue.title'),
description: t('workflow.nodes.common.errorHandle.defaultValue.desc'),
label: t('nodes.common.errorHandle.defaultValue.title', { ns: 'workflow' }),
description: t('nodes.common.errorHandle.defaultValue.desc', { ns: 'workflow' }),
},
{
value: ErrorHandleTypeEnum.failBranch,
label: t('workflow.nodes.common.errorHandle.failBranch.title'),
description: t('workflow.nodes.common.errorHandle.failBranch.desc'),
label: t('nodes.common.errorHandle.failBranch.title', { ns: 'workflow' }),
description: t('nodes.common.errorHandle.failBranch.desc', { ns: 'workflow' }),
},
]
const selectedOption = options.find(option => option.value === value)

View File

@ -13,17 +13,17 @@ const FailBranchCard = () => {
<RiMindMap className="h-5 w-5 text-text-tertiary" />
</div>
<div className="system-sm-medium mb-1 text-text-secondary">
{t('workflow.nodes.common.errorHandle.failBranch.customize')}
{t('nodes.common.errorHandle.failBranch.customize', { ns: 'workflow' })}
</div>
<div className="system-xs-regular text-text-tertiary">
{t('workflow.nodes.common.errorHandle.failBranch.customizeTip')}
{t('nodes.common.errorHandle.failBranch.customizeTip', { ns: 'workflow' })}
&nbsp;
<a
href={docLink('/guides/workflow/error-handling/error-type')}
target="_blank"
className="text-text-accent"
>
{t('workflow.common.learnMore')}
{t('common.learnMore', { ns: 'workflow' })}
</a>
</div>
</div>

View File

@ -49,14 +49,14 @@ const FileTypeItem: FC<Props> = ({
<div>
<div className="flex items-center border-b border-divider-subtle p-3 pb-2">
<FileTypeIcon className="shrink-0" type={type} size="lg" />
<div className="system-sm-medium mx-2 grow text-text-primary">{t(`appDebug.variableConfig.file.${type}.name`)}</div>
<div className="system-sm-medium mx-2 grow text-text-primary">{t(`variableConfig.file.${type}.name`, { ns: 'appDebug' })}</div>
<Checkbox className="shrink-0" checked={selected} />
</div>
<div className="p-3" onClick={e => e.stopPropagation()}>
<TagInput
items={customFileTypes}
onChange={onCustomFileTypesChange}
placeholder={t('appDebug.variableConfig.file.custom.createPlaceholder')!}
placeholder={t('variableConfig.file.custom.createPlaceholder', { ns: 'appDebug' })!}
/>
</div>
</div>
@ -65,8 +65,8 @@ const FileTypeItem: FC<Props> = ({
<div className="flex items-center">
<FileTypeIcon className="shrink-0" type={type} size="lg" />
<div className="mx-2 grow">
<div className="system-sm-medium text-text-primary">{t(`appDebug.variableConfig.file.${type}.name`)}</div>
<div className="system-2xs-regular-uppercase mt-1 text-text-tertiary">{type !== SupportUploadFileTypes.custom ? FILE_EXTS[type].join(', ') : t('appDebug.variableConfig.file.custom.description')}</div>
<div className="system-sm-medium text-text-primary">{t(`variableConfig.file.${type}.name`, { ns: 'appDebug' })}</div>
<div className="system-2xs-regular-uppercase mt-1 text-text-tertiary">{type !== SupportUploadFileTypes.custom ? FILE_EXTS[type].join(', ') : t('variableConfig.file.custom.description', { ns: 'appDebug' })}</div>
</div>
<Checkbox className="shrink-0" checked={selected} />
</div>

View File

@ -99,7 +99,7 @@ const FileUploadSetting: FC<Props> = ({
<div>
{!inFeaturePanel && (
<Field
title={t('appDebug.variableConfig.file.supportFileTypes')}
title={t('variableConfig.file.supportFileTypes', { ns: 'appDebug' })}
>
<div className="space-y-1">
{
@ -123,12 +123,12 @@ const FileUploadSetting: FC<Props> = ({
</Field>
)}
<Field
title={t('appDebug.variableConfig.uploadFileTypes')}
title={t('variableConfig.uploadFileTypes', { ns: 'appDebug' })}
className="mt-4"
>
<div className="grid grid-cols-3 gap-2">
<OptionCard
title={t('appDebug.variableConfig.localUpload')}
title={t('variableConfig.localUpload', { ns: 'appDebug' })}
selected={allowed_file_upload_methods.length === 1 && allowed_file_upload_methods.includes(TransferMethod.local_file)}
onSelect={handleUploadMethodChange(TransferMethod.local_file)}
/>
@ -138,7 +138,7 @@ const FileUploadSetting: FC<Props> = ({
onSelect={handleUploadMethodChange(TransferMethod.remote_url)}
/>
<OptionCard
title={t('appDebug.variableConfig.both')}
title={t('variableConfig.both', { ns: 'appDebug' })}
selected={allowed_file_upload_methods.includes(TransferMethod.local_file) && allowed_file_upload_methods.includes(TransferMethod.remote_url)}
onSelect={handleUploadMethodChange(TransferMethod.all)}
/>
@ -147,11 +147,12 @@ const FileUploadSetting: FC<Props> = ({
{isMultiple && (
<Field
className="mt-4"
title={t('appDebug.variableConfig.maxNumberOfUploads')!}
title={t('variableConfig.maxNumberOfUploads', { ns: 'appDebug' })!}
>
<div>
<div className="body-xs-regular mb-1.5 text-text-tertiary">
{t('appDebug.variableConfig.maxNumberTip', {
{t('variableConfig.maxNumberTip', {
ns: 'appDebug',
imgLimit: formatFileSize(imgSizeLimit),
docLimit: formatFileSize(docSizeLimit),
audioLimit: formatFileSize(audioSizeLimit),
@ -170,7 +171,7 @@ const FileUploadSetting: FC<Props> = ({
)}
{inFeaturePanel && !hideSupportFileType && (
<Field
title={t('appDebug.variableConfig.file.supportFileTypes')}
title={t('variableConfig.file.supportFileTypes', { ns: 'appDebug' })}
className="mt-4"
>
<div className="space-y-1">

View File

@ -22,7 +22,7 @@ const FormInputTypeSwitch: FC<Props> = ({
return (
<div className="inline-flex h-8 shrink-0 gap-px rounded-[10px] bg-components-segmented-control-bg-normal p-0.5">
<Tooltip
popupContent={value === VarType.variable ? '' : t('workflow.nodes.common.typeSwitch.variable')}
popupContent={value === VarType.variable ? '' : t('nodes.common.typeSwitch.variable', { ns: 'workflow' })}
>
<div
className={cn('cursor-pointer rounded-lg px-2.5 py-1.5 text-text-tertiary hover:bg-state-base-hover', value === VarType.variable && 'bg-components-segmented-control-item-active-bg text-text-secondary shadow-xs hover:bg-components-segmented-control-item-active-bg')}
@ -32,7 +32,7 @@ const FormInputTypeSwitch: FC<Props> = ({
</div>
</Tooltip>
<Tooltip
popupContent={value === VarType.constant ? '' : t('workflow.nodes.common.typeSwitch.input')}
popupContent={value === VarType.constant ? '' : t('nodes.common.typeSwitch.input', { ns: 'workflow' })}
>
<div
className={cn('cursor-pointer rounded-lg px-2.5 py-1.5 text-text-tertiary hover:bg-state-base-hover', value === VarType.constant && 'bg-components-segmented-control-item-active-bg text-text-secondary shadow-xs hover:bg-components-segmented-control-item-active-bg')}

View File

@ -19,7 +19,7 @@ const HelpLink = ({
return (
<TooltipPlus
popupContent={t('common.userProfile.helpCenter')}
popupContent={t('userProfile.helpCenter', { ns: 'common' })}
>
<a
href={link}

View File

@ -101,7 +101,7 @@ const Editor: FC<Props> = ({
}
if (node.data.type === BlockEnum.Start) {
acc.sys = {
title: t('workflow.blocks.start'),
title: t('blocks.start', { ns: 'workflow' }),
type: BlockEnum.Start,
}
}
@ -120,7 +120,7 @@ const Editor: FC<Props> = ({
{isFocus && (
<div className={cn('absolute z-10', insertVarTipToLeft ? 'left-[-12px] top-1.5' : ' right-1 top-[-9px]')}>
<Tooltip
popupContent={`${t('workflow.common.insertVarTip')}`}
popupContent={`${t('common.insertVarTip', { ns: 'workflow' })}`}
>
<div className="cursor-pointer rounded-[5px] border-[0.5px] border-divider-regular bg-components-badge-white-to-dark p-0.5 shadow-lg">
<Variable02 className="h-3.5 w-3.5 text-components-button-secondary-accent-text" />

View File

@ -101,7 +101,7 @@ export const InstallPluginButton = (props: InstallPluginButtonProps) => {
onClick={handleInstall}
className={cn('flex items-center', className)}
>
{!isLoading ? t('workflow.nodes.agent.pluginInstaller.install') : t('workflow.nodes.agent.pluginInstaller.installing')}
{!isLoading ? t('nodes.agent.pluginInstaller.install', { ns: 'workflow' }) : t('nodes.agent.pluginInstaller.installing', { ns: 'workflow' })}
{!isLoading ? <RiInstallLine className="ml-1 size-3.5" /> : <RiLoader2Line className="ml-1 size-3.5 animate-spin" />}
</Button>
)

View File

@ -11,7 +11,7 @@ const McpToolNotSupportTooltip: FC = () => {
<Tooltip
popupContent={(
<div className="w-[256px]">
{t('plugin.detailPanel.toolSelector.unsupportedMCPTool')}
{t('detailPanel.toolSelector.unsupportedMCPTool', { ns: 'plugin' })}
</div>
)}
>

View File

@ -12,7 +12,7 @@ import Field from '@/app/components/workflow/nodes/_base/components/field'
import { cn } from '@/utils/classnames'
import { MemoryRole } from '../../../types'
const i18nPrefix = 'workflow.nodes.common.memory'
const i18nPrefix = 'nodes.common.memory'
const WINDOW_SIZE_MIN = 1
const WINDOW_SIZE_MAX = 100
const WINDOW_SIZE_DEFAULT = 50
@ -132,8 +132,8 @@ const MemoryConfig: FC<Props> = ({
return (
<div className={cn(className)}>
<Field
title={t(`${i18nPrefix}.memory`)}
tooltip={t(`${i18nPrefix}.memoryTip`)!}
title={t(`${i18nPrefix}.memory`, { ns: 'workflow' })}
tooltip={t(`${i18nPrefix}.memoryTip`, { ns: 'workflow' })!}
operations={(
<Switch
defaultValue={!!payload}
@ -154,7 +154,7 @@ const MemoryConfig: FC<Props> = ({
size="md"
disabled={readonly}
/>
<div className="system-xs-medium-uppercase text-text-tertiary">{t(`${i18nPrefix}.windowSize`)}</div>
<div className="system-xs-medium-uppercase text-text-tertiary">{t(`${i18nPrefix}.windowSize`, { ns: 'workflow' })}</div>
</div>
<div className="flex h-8 items-center space-x-2">
<Slider
@ -182,17 +182,17 @@ const MemoryConfig: FC<Props> = ({
</div>
{canSetRoleName && (
<div className="mt-4">
<div className="text-xs font-medium uppercase leading-6 text-text-tertiary">{t(`${i18nPrefix}.conversationRoleName`)}</div>
<div className="text-xs font-medium uppercase leading-6 text-text-tertiary">{t(`${i18nPrefix}.conversationRoleName`, { ns: 'workflow' })}</div>
<div className="mt-1 space-y-2">
<RoleItem
readonly={readonly}
title={t(`${i18nPrefix}.user`)}
title={t(`${i18nPrefix}.user`, { ns: 'workflow' })}
value={payload.role_prefix?.user || ''}
onChange={handleRolePrefixChange(MemoryRole.user)}
/>
<RoleItem
readonly={readonly}
title={t(`${i18nPrefix}.assistant`)}
title={t(`${i18nPrefix}.assistant`, { ns: 'workflow' })}
value={payload.role_prefix?.assistant || ''}
onChange={handleRolePrefixChange(MemoryRole.assistant)}
/>

View File

@ -46,7 +46,7 @@ const MixedVariableTextInput = ({
}
if (node.data.type === BlockEnum.Start) {
acc.sys = {
title: t('workflow.blocks.start'),
title: t('blocks.start', { ns: 'workflow' }),
type: BlockEnum.Start,
}
}

View File

@ -26,7 +26,7 @@ const Placeholder = () => {
}}
>
<div className="flex grow items-center">
{t('workflow.nodes.tool.insertPlaceholder1')}
{t('nodes.tool.insertPlaceholder1', { ns: 'workflow' })}
<div className="system-kbd mx-0.5 flex h-4 w-4 items-center justify-center rounded bg-components-kbd-bg-gray text-text-placeholder">/</div>
<div
className="system-sm-regular cursor-pointer text-components-input-text-placeholder underline decoration-dotted decoration-auto underline-offset-auto hover:text-text-tertiary"
@ -36,7 +36,7 @@ const Placeholder = () => {
handleInsert('/')
})}
>
{t('workflow.nodes.tool.insertPlaceholder2')}
{t('nodes.tool.insertPlaceholder2', { ns: 'workflow' })}
</div>
</div>
<Badge

View File

@ -58,12 +58,12 @@ const Add = ({
const tip = useMemo(() => {
if (isFailBranch)
return t('workflow.common.addFailureBranch')
return t('common.addFailureBranch', { ns: 'workflow' })
if (isParallel)
return t('workflow.common.addParallelNode')
return t('common.addParallelNode', { ns: 'workflow' })
return t('workflow.panel.selectNextStep')
return t('panel.selectNextStep', { ns: 'workflow' })
}, [isFailBranch, isParallel, t])
const renderTrigger = useCallback((open: boolean) => {
return (

View File

@ -53,7 +53,7 @@ const NextStep = ({
return {
branch: {
...branch,
name: data.type === BlockEnum.QuestionClassifier ? `${t('workflow.nodes.questionClassifiers.class')} ${index + 1}` : branch.name,
name: data.type === BlockEnum.QuestionClassifier ? `${t('nodes.questionClassifiers.class', { ns: 'workflow' })} ${index + 1}` : branch.name,
},
nextNodes,
}
@ -78,7 +78,7 @@ const NextStep = ({
items.push({
branch: {
id: ErrorHandleTypeEnum.failBranch,
name: t('workflow.common.onFailure'),
name: t('common.onFailure', { ns: 'workflow' }),
},
nextNodes,
})

View File

@ -60,7 +60,7 @@ const Item = ({
size="small"
onClick={() => handleNodeSelect(nodeId)}
>
{t('workflow.common.jumpToNode')}
{t('common.jumpToNode', { ns: 'workflow' })}
</Button>
<div
className={cn(

View File

@ -45,7 +45,7 @@ const ChangeItem = ({
const renderTrigger = useCallback(() => {
return (
<div className="flex h-8 cursor-pointer items-center rounded-lg px-2 hover:bg-state-base-hover">
{t('workflow.panel.change')}
{t('panel.change', { ns: 'workflow' })}
</div>
)
}, [t])
@ -109,7 +109,7 @@ const Operator = ({
className="flex h-8 cursor-pointer items-center rounded-lg px-2 hover:bg-state-base-hover"
onClick={() => handleNodeDisconnect(nodeId)}
>
{t('workflow.common.disconnect')}
{t('common.disconnect', { ns: 'workflow' })}
</div>
</div>
<div className="p-1">
@ -117,7 +117,7 @@ const Operator = ({
className="flex h-8 cursor-pointer items-center rounded-lg px-2 hover:bg-state-base-hover"
onClick={() => handleNodeDelete(nodeId)}
>
{t('common.operation.delete')}
{t('operation.delete', { ns: 'common' })}
</div>
</div>
</div>

View File

@ -70,7 +70,7 @@ const NodeControl: FC<NodeControlProps> = ({
? <Stop className="h-3 w-3" />
: (
<Tooltip
popupContent={t('workflow.panel.runThisStep')}
popupContent={t('panel.runThisStep', { ns: 'workflow' })}
asChild={false}
>
<RiPlayLargeLine className="h-3 w-3" />

View File

@ -204,12 +204,12 @@ export const NodeSourceHandle = memo(({
<div className="absolute -top-1 left-1/2 hidden -translate-x-1/2 -translate-y-full rounded-lg border-[0.5px] border-components-panel-border bg-components-tooltip-bg p-1.5 shadow-lg group-hover/handle:block">
<div className="system-xs-regular text-text-tertiary">
<div className=" whitespace-nowrap">
<span className="system-xs-medium text-text-secondary">{t('workflow.common.parallelTip.click.title')}</span>
{t('workflow.common.parallelTip.click.desc')}
<span className="system-xs-medium text-text-secondary">{t('common.parallelTip.click.title', { ns: 'workflow' })}</span>
{t('common.parallelTip.click.desc', { ns: 'workflow' })}
</div>
<div>
<span className="system-xs-medium text-text-secondary">{t('workflow.common.parallelTip.drag.title')}</span>
{t('workflow.common.parallelTip.drag.desc')}
<span className="system-xs-medium text-text-secondary">{t('common.parallelTip.drag.title', { ns: 'workflow' })}</span>
{t('common.parallelTip.drag.desc', { ns: 'workflow' })}
</div>
</div>
</div>

View File

@ -25,7 +25,7 @@ const OutputVars: FC<Props> = ({
const { t } = useTranslation()
return (
<FieldCollapse
title={title || t('workflow.nodes.common.outputVars')}
title={title || t('nodes.common.outputVars', { ns: 'workflow' })}
operations={operations}
collapsed={collapsed}
onCollapse={onCollapse}

View File

@ -61,7 +61,7 @@ const ChangeBlock = ({
const renderTrigger = useCallback(() => {
return (
<div className="flex h-8 w-[232px] cursor-pointer items-center rounded-lg px-3 text-sm text-text-secondary hover:bg-state-base-hover">
{t('workflow.panel.changeBlock')}
{t('panel.changeBlock', { ns: 'workflow' })}
</div>
)
}, [t])

View File

@ -79,7 +79,7 @@ const PanelOperatorPopup = ({
onClosePopup()
}}
>
{t('workflow.panel.runThisStep')}
{t('panel.runThisStep', { ns: 'workflow' })}
</div>
)
}
@ -111,7 +111,7 @@ const PanelOperatorPopup = ({
handleNodesCopy(id)
}}
>
{t('workflow.common.copy')}
{t('common.copy', { ns: 'workflow' })}
<ShortcutsName keys={['ctrl', 'c']} />
</div>
<div
@ -121,7 +121,7 @@ const PanelOperatorPopup = ({
handleNodesDuplicate(id)
}}
>
{t('workflow.common.duplicate')}
{t('common.duplicate', { ns: 'workflow' })}
<ShortcutsName keys={['ctrl', 'd']} />
</div>
</div>
@ -140,7 +140,7 @@ const PanelOperatorPopup = ({
`}
onClick={() => handleNodeDelete(id)}
>
{t('common.operation.delete')}
{t('operation.delete', { ns: 'common' })}
<ShortcutsName keys={['del']} />
</div>
</div>
@ -160,7 +160,7 @@ const PanelOperatorPopup = ({
target="_blank"
className="flex h-8 cursor-pointer items-center rounded-lg px-3 text-sm text-text-secondary hover:bg-state-base-hover"
>
{t('workflow.panel.openWorkflow')}
{t('panel.openWorkflow', { ns: 'workflow' })}
</a>
</div>
<div className="h-px bg-divider-regular"></div>
@ -176,7 +176,7 @@ const PanelOperatorPopup = ({
target="_blank"
className="flex h-8 cursor-pointer items-center rounded-lg px-3 text-sm text-text-secondary hover:bg-state-base-hover"
>
{t('workflow.panel.helpLink')}
{t('panel.helpLink', { ns: 'workflow' })}
</a>
</div>
<div className="h-px bg-divider-regular"></div>
@ -186,11 +186,11 @@ const PanelOperatorPopup = ({
<div className="p-1">
<div className="px-3 py-2 text-xs text-text-tertiary">
<div className="mb-1 flex h-[22px] items-center font-medium">
{t('workflow.panel.about').toLocaleUpperCase()}
{t('panel.about', { ns: 'workflow' }).toLocaleUpperCase()}
</div>
<div className="mb-1 leading-[18px] text-text-secondary">{nodeMetaData.description}</div>
<div className="leading-[18px]">
{t('workflow.panel.createdBy')}
{t('panel.createdBy', { ns: 'workflow' })}
{' '}
{nodeMetaData.author}
</div>

View File

@ -187,8 +187,8 @@ const Editor: FC<Props> = ({
<Tooltip
popupContent={(
<div>
<div>{t('workflow.common.enableJinja')}</div>
<a className="text-text-accent" target="_blank" href="https://jinja.palletsprojects.com/en/2.10.x/">{t('workflow.common.learnMore')}</a>
<div>{t('common.enableJinja', { ns: 'workflow' })}</div>
<a className="text-text-accent" target="_blank" href="https://jinja.palletsprojects.com/en/2.10.x/">{t('common.learnMore', { ns: 'workflow' })}</a>
</div>
)}
>
@ -207,7 +207,7 @@ const Editor: FC<Props> = ({
)}
{!readOnly && (
<Tooltip
popupContent={`${t('workflow.common.insertVarTip')}`}
popupContent={`${t('common.insertVarTip', { ns: 'workflow' })}`}
>
<ActionButton onClick={handleInsertVariable}>
<Variable02 className="h-4 w-4" />
@ -281,7 +281,7 @@ const Editor: FC<Props> = ({
}
if (node.data.type === BlockEnum.Start) {
acc.sys = {
title: t('workflow.blocks.start'),
title: t('blocks.start', { ns: 'workflow' }),
type: BlockEnum.Start,
}
}

View File

@ -9,7 +9,7 @@ type Props = {
onConfirm: () => void
onCancel: () => void
}
const i18nPrefix = 'workflow.common.effectVarConfirm'
const i18nPrefix = 'common.effectVarConfirm'
const RemoveVarConfirm: FC<Props> = ({
isShow,
@ -21,8 +21,8 @@ const RemoveVarConfirm: FC<Props> = ({
return (
<Confirm
isShow={isShow}
title={t(`${i18nPrefix}.title`)}
content={t(`${i18nPrefix}.content`)}
title={t(`${i18nPrefix}.title`, { ns: 'workflow' })}
content={t(`${i18nPrefix}.content`, { ns: 'workflow' })}
onConfirm={onConfirm}
onCancel={onCancel}
/>

View File

@ -49,14 +49,14 @@ const RetryOnNode = ({
<div className="flex items-center">
{
showDefault && (
t('workflow.nodes.common.retry.retryTimes', { times: retry_config.max_retries })
t('nodes.common.retry.retryTimes', { ns: 'workflow', times: retry_config.max_retries })
)
}
{
isRunning && (
<>
<RiLoader2Line className="mr-1 h-3.5 w-3.5 animate-spin" />
{t('workflow.nodes.common.retry.retrying')}
{t('nodes.common.retry.retrying', { ns: 'workflow' })}
</>
)
}
@ -64,7 +64,7 @@ const RetryOnNode = ({
isSuccessful && (
<>
<RiCheckboxCircleFill className="mr-1 h-3.5 w-3.5" />
{t('workflow.nodes.common.retry.retrySuccessful')}
{t('nodes.common.retry.retrySuccessful', { ns: 'workflow' })}
</>
)
}
@ -72,7 +72,7 @@ const RetryOnNode = ({
(isFailed || isException) && (
<>
<RiAlertFill className="mr-1 h-3.5 w-3.5" />
{t('workflow.nodes.common.retry.retryFailed')}
{t('nodes.common.retry.retryFailed', { ns: 'workflow' })}
</>
)
}

View File

@ -55,7 +55,7 @@ const RetryOnPanel = ({
<div className="pt-2">
<div className="flex h-10 items-center justify-between px-4 py-2">
<div className="flex items-center">
<div className="system-sm-semibold-uppercase mr-0.5 text-text-secondary">{t('workflow.nodes.common.retry.retryOnFailure')}</div>
<div className="system-sm-semibold-uppercase mr-0.5 text-text-secondary">{t('nodes.common.retry.retryOnFailure', { ns: 'workflow' })}</div>
</div>
<Switch
defaultValue={retry_config?.retry_enabled}
@ -66,7 +66,7 @@ const RetryOnPanel = ({
retry_config?.retry_enabled && (
<div className="px-4 pb-2">
<div className="mb-1 flex w-full items-center">
<div className="system-xs-medium-uppercase mr-2 grow text-text-secondary">{t('workflow.nodes.common.retry.maxRetries')}</div>
<div className="system-xs-medium-uppercase mr-2 grow text-text-secondary">{t('nodes.common.retry.maxRetries', { ns: 'workflow' })}</div>
<Slider
className="mr-3 w-[108px]"
value={retry_config?.max_retries || 3}
@ -82,12 +82,12 @@ const RetryOnPanel = ({
handleMaxRetriesChange(Number.parseInt(e.currentTarget.value, 10) || 3)}
min={1}
max={10}
unit={t('workflow.nodes.common.retry.times') || ''}
unit={t('nodes.common.retry.times', { ns: 'workflow' }) || ''}
className={s.input}
/>
</div>
<div className="flex items-center">
<div className="system-xs-medium-uppercase mr-2 grow text-text-secondary">{t('workflow.nodes.common.retry.retryInterval')}</div>
<div className="system-xs-medium-uppercase mr-2 grow text-text-secondary">{t('nodes.common.retry.retryInterval', { ns: 'workflow' })}</div>
<Slider
className="mr-3 w-[108px]"
value={retry_config?.retry_interval || 1000}
@ -103,7 +103,7 @@ const RetryOnPanel = ({
handleRetryIntervalChange(Number.parseInt(e.currentTarget.value, 10) || 1000)}
min={100}
max={5000}
unit={t('workflow.nodes.common.retry.ms') || ''}
unit={t('nodes.common.retry.ms', { ns: 'workflow' }) || ''}
className={s.input}
/>
</div>

View File

@ -79,10 +79,10 @@ export const SwitchPluginVersion: FC<SwitchPluginVersionProps> = (props) => {
})}
mutation={mutation}
mutate={install}
confirmButtonText={t('workflow.nodes.agent.installPlugin.install')}
cancelButtonText={t('workflow.nodes.agent.installPlugin.cancel')}
modelTitle={t('workflow.nodes.agent.installPlugin.title')}
description={t('workflow.nodes.agent.installPlugin.desc')}
confirmButtonText={t('nodes.agent.installPlugin.install', { ns: 'workflow' })}
cancelButtonText={t('nodes.agent.installPlugin.cancel', { ns: 'workflow' })}
modelTitle={t('nodes.agent.installPlugin.title', { ns: 'workflow' })}
description={t('nodes.agent.installPlugin.desc', { ns: 'workflow' })}
cardTitleLeft={(
<>
<Badge2 className="mx-1" size="s" state={BadgeState.Warning}>
@ -97,7 +97,7 @@ export const SwitchPluginVersion: FC<SwitchPluginVersionProps> = (props) => {
target="_blank"
>
<span className="system-xs-regular text-xs text-text-accent">
{t('workflow.nodes.agent.installPlugin.changelog')}
{t('nodes.agent.installPlugin.changelog', { ns: 'workflow' })}
</span>
<RiExternalLinkLine className="size-3 text-text-accent" />
</Link>

View File

@ -36,7 +36,7 @@ export const TitleInput = memo(({
system-xl-semibold mr-2 h-7 min-w-0 grow appearance-none rounded-md border border-transparent bg-transparent px-1 text-text-primary
outline-none focus:shadow-xs
`}
placeholder={t('workflow.common.addTitle') || ''}
placeholder={t('common.addTitle', { ns: 'workflow' }) || ''}
onBlur={handleBlur}
/>
)
@ -79,7 +79,7 @@ export const DescriptionInput = memo(({
leading-[18px] text-text-primary caret-[#295EFF]
outline-none placeholder:text-text-quaternary
`}
placeholder={t('workflow.common.addDescription') || ''}
placeholder={t('common.addDescription', { ns: 'workflow' }) || ''}
/>
</div>
)

View File

@ -81,7 +81,7 @@ const VariableTag = ({
handleVariableJump()
}
}}
errorMsg={!isValid ? t('workflow.errorMsg.invalidVariable') : undefined}
errorMsg={!isValid ? t('errorMsg.invalidVariable', { ns: 'workflow' }) : undefined}
isExceptionVariable={isException}
/>
)

View File

@ -23,8 +23,8 @@ const AssignedVarReferencePopup: FC<Props> = ({
{(!vars || vars.length === 0)
? (
<ListEmpty
title={t('workflow.nodes.assigner.noAssignedVars') || ''}
description={t('workflow.nodes.assigner.assignedVarsDescription')}
title={t('nodes.assigner.noAssignedVars', { ns: 'workflow' }) || ''}
description={t('nodes.assigner.assignedVarsDescription', { ns: 'workflow' })}
/>
)
: (

View File

@ -21,7 +21,7 @@ const ManageInputField = ({
className="system-xs-medium truncate text-text-tertiary"
title="Create user input field"
>
{t('pipeline.inputField.create')}
{t('inputField.create', { ns: 'pipeline' })}
</div>
</div>
<div className="mx-1 h-3 w-[1px] shrink-0 bg-divider-regular"></div>
@ -29,7 +29,7 @@ const ManageInputField = ({
className="system-xs-medium flex h-8 shrink-0 cursor-pointer items-center justify-center px-3 text-text-tertiary"
onClick={onManage}
>
{t('pipeline.inputField.manage')}
{t('inputField.manage', { ns: 'pipeline' })}
</div>
</div>
)

View File

@ -38,7 +38,7 @@ const Field: FC<Props> = ({
return null
return (
<div>
<Tooltip popupContent={t('app.structOutput.moreFillTip')} disabled={depth !== MAX_DEPTH + 1}>
<Tooltip popupContent={t('structOutput.moreFillTip', { ns: 'app' })} disabled={depth !== MAX_DEPTH + 1}>
<div
className={cn('flex items-center justify-between rounded-md pr-2', !readonly && 'hover:bg-state-base-hover', depth !== MAX_DEPTH + 1 && 'cursor-pointer')}
onMouseDown={() => !readonly && onSelect?.([...valueSelector, name])}

View File

@ -49,7 +49,7 @@ const Field: FC<Props> = ({
{getFieldType(payload)}
{(payload.schemaType && payload.schemaType !== 'file' && ` (${payload.schemaType})`)}
</div>
{required && <div className="system-2xs-medium-uppercase ml-3 leading-6 text-text-warning">{t('app.structOutput.required')}</div>}
{required && <div className="system-2xs-medium-uppercase ml-3 leading-6 text-text-warning">{t('structOutput.required', { ns: 'app' })}</div>}
</div>
{payload.description && (
<div className="ml-[7px] flex">

View File

@ -19,7 +19,7 @@ const ShowPanel: FC<Props> = ({
...payload,
schema: {
...payload.schema,
description: t('app.structOutput.LLMResponse'),
description: t('structOutput.LLMResponse', { ns: 'app' }),
},
}
return (

View File

@ -40,18 +40,18 @@ const OutputVarList: FC<Props> = ({
})
const { run: validateVarInput } = useDebounceFn((existingVariables: typeof list, newKey: string) => {
const { isValid, errorKey, errorMessageKey } = checkKeys([newKey], true)
if (!isValid) {
const result = checkKeys([newKey], true)
if (!result.isValid) {
setToastHandler(Toast.notify({
type: 'error',
message: t(`appDebug.varKeyError.${errorMessageKey}` as any, { key: errorKey }),
message: t(`varKeyError.${result.errorMessageKey}`, { ns: 'appDebug', key: result.errorKey }),
}))
return
}
if (existingVariables.some(key => key.variable?.trim() === newKey.trim())) {
setToastHandler(Toast.notify({
type: 'error',
message: t('appDebug.varKeyError.keyAlreadyExists', { key: newKey }),
message: t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: newKey }),
}))
}
else {

View File

@ -1233,7 +1233,7 @@ export const toNodeAvailableVars = ({
: {}
const iterationVar = {
nodeId: iterationNode?.id,
title: t('workflow.nodes.iteration.currentIteration'),
title: t('nodes.iteration.currentIteration', { ns: 'workflow' }),
vars: [
{
variable: 'item',

View File

@ -53,18 +53,18 @@ const VarList: FC<Props> = ({
}), [list])
const { run: validateVarInput } = useDebounceFn((list: Variable[], newKey: string) => {
const { isValid, errorKey, errorMessageKey } = checkKeys([newKey], true)
if (!isValid) {
const result = checkKeys([newKey], true)
if (!result.isValid) {
setToastHandle(Toast.notify({
type: 'error',
message: t(`appDebug.varKeyError.${errorMessageKey}` as any, { key: errorKey }),
message: t(`varKeyError.${result.errorMessageKey}`, { ns: 'appDebug', key: result.errorKey }),
}))
return
}
if (list.some(item => item.variable?.trim() === newKey.trim())) {
setToastHandle(Toast.notify({
type: 'error',
message: t('appDebug.varKeyError.keyAlreadyExists', { key: newKey }),
message: t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: newKey }),
}))
}
else {
@ -152,7 +152,7 @@ const VarList: FC<Props> = ({
disabled={readonly}
value={variable.variable}
onChange={handleVarNameChange(index)}
placeholder={t('workflow.common.variableNamePlaceholder')!}
placeholder={t('common.variableNamePlaceholder', { ns: 'workflow' })!}
/>
<VarReferencePicker
nodeId={nodeId}

View File

@ -341,7 +341,7 @@ const VarReferencePicker: FC<Props> = ({
)
}
if (!isValidVar && hasValue)
return t('workflow.errorMsg.invalidVariable')
return t('errorMsg.invalidVariable', { ns: 'workflow' })
return null
}, [isValidVar, isShowAPart, hasValue, t, outputVarNode?.title, outputVarNode?.type, value, type])
@ -574,11 +574,11 @@ const VarReferencePicker: FC<Props> = ({
? (
<div className="flex items-center">
<RiLoader4Line className="mr-1 h-3.5 w-3.5 animate-spin text-text-secondary" />
<span>{placeholder ?? t('workflow.common.setVarValuePlaceholder')}</span>
<span>{placeholder ?? t('common.setVarValuePlaceholder', { ns: 'workflow' })}</span>
</div>
)
: (
placeholder ?? t('workflow.common.setVarValuePlaceholder')
placeholder ?? t('common.setVarValuePlaceholder', { ns: 'workflow' })
)}
</div>
)}

View File

@ -44,20 +44,20 @@ const VarReferencePopup: FC<Props> = ({
? (popupFor === 'toAssigned'
? (
<ListEmpty
title={t('workflow.variableReference.noAvailableVars') || ''}
title={t('variableReference.noAvailableVars', { ns: 'workflow' }) || ''}
description={(
<div className="system-xs-regular text-text-tertiary">
{t('workflow.variableReference.noVarsForOperation')}
{t('variableReference.noVarsForOperation', { ns: 'workflow' })}
</div>
)}
/>
)
: (
<ListEmpty
title={t('workflow.variableReference.noAssignedVars') || ''}
title={t('variableReference.noAssignedVars', { ns: 'workflow' }) || ''}
description={(
<div className="system-xs-regular text-text-tertiary">
{t('workflow.variableReference.assignedVarsDescription')}
{t('variableReference.assignedVarsDescription', { ns: 'workflow' })}
<a
target="_blank"
rel="noopener noreferrer"
@ -67,7 +67,7 @@ const VarReferencePopup: FC<Props> = ({
'ja-JP': '/guides/workflow/variables#会話変数',
})}
>
{t('workflow.variableReference.conversationVars')}
{t('variableReference.conversationVars', { ns: 'workflow' })}
</a>
</div>
)}

View File

@ -321,7 +321,7 @@ const VarReferenceVars: FC<Props> = ({
showLeftIcon
showClearIcon
value={searchText}
placeholder={t('workflow.common.searchVar') || ''}
placeholder={t('common.searchVar', { ns: 'workflow' }) || ''}
onChange={e => setSearchText(e.target.value)}
onKeyDown={handleKeyDown}
onClear={() => setSearchText('')}
@ -376,7 +376,7 @@ const VarReferenceVars: FC<Props> = ({
{item.isFlat && !filteredVars[i + 1]?.isFlat && !!filteredVars.find(item => !item.isFlat) && (
<div className="relative mt-[14px] flex items-center space-x-1">
<div className="h-0 w-3 shrink-0 border border-divider-subtle"></div>
<div className="system-2xs-semibold-uppercase text-text-tertiary">{t('workflow.debug.lastOutput')}</div>
<div className="system-2xs-semibold-uppercase text-text-tertiary">{t('debug.lastOutput', { ns: 'workflow' })}</div>
<div className="h-0 shrink-0 grow border border-divider-subtle"></div>
</div>
)}
@ -385,7 +385,7 @@ const VarReferenceVars: FC<Props> = ({
}
</div>
)
: <div className="mt-2 pl-3 text-xs font-medium uppercase leading-[18px] text-gray-500">{t('workflow.common.noVar')}</div>}
: <div className="mt-2 pl-3 text-xs font-medium uppercase leading-[18px] text-gray-500">{t('common.noVar', { ns: 'workflow' })}</div>}
{
showManageInputField && (
<ManageInputField

View File

@ -492,7 +492,7 @@ const BasePanel: FC<BasePanelProps> = ({
{
isSupportSingleRun && !nodesReadOnly && (
<Tooltip
popupContent={t('workflow.panel.runThisStep')}
popupContent={t('panel.runThisStep', { ns: 'workflow' })}
popupClassName="mr-1"
disabled={isSingleRunning}
>
@ -642,10 +642,10 @@ const BasePanel: FC<BasePanelProps> = ({
!!availableNextBlocks.length && (
<div className="border-t-[0.5px] border-divider-regular p-4">
<div className="system-sm-semibold-uppercase mb-1 flex items-center text-text-secondary">
{t('workflow.panel.nextStep').toLocaleUpperCase()}
{t('panel.nextStep', { ns: 'workflow' }).toLocaleUpperCase()}
</div>
<div className="system-xs-regular mb-2 text-text-tertiary">
{t('workflow.panel.addNextStep')}
{t('panel.addNextStep', { ns: 'workflow' })}
</div>
<NextStep selectedNode={selectedNode} />
</div>

View File

@ -19,7 +19,7 @@ const NoData: FC<Props> = ({
return (
<div className="flex h-0 grow flex-col items-center justify-center">
<ClockPlay className="h-8 w-8 text-text-quaternary" />
<div className="system-xs-regular my-2 text-text-tertiary">{t('workflow.debug.noData.description')}</div>
<div className="system-xs-regular my-2 text-text-tertiary">{t('debug.noData.description', { ns: 'workflow' })}</div>
{canSingleRun && (
<Button
className="flex"
@ -27,7 +27,7 @@ const NoData: FC<Props> = ({
onClick={onSingleRun}
>
<RiPlayLine className="mr-1 h-3.5 w-3.5" />
<div>{t('workflow.debug.noData.runThisNode')}</div>
<div>{t('debug.noData.runThisNode', { ns: 'workflow' })}</div>
</Button>
)}
</div>

View File

@ -23,8 +23,8 @@ const Tab: FC<Props> = ({
return (
<TabHeader
items={[
{ id: TabType.settings, name: t('workflow.debug.settingsTab').toLocaleUpperCase() },
{ id: TabType.lastRun, name: t('workflow.debug.lastRunTab').toLocaleUpperCase() },
{ id: TabType.settings, name: t('debug.settingsTab', { ns: 'workflow' }).toLocaleUpperCase() },
{ id: TabType.lastRun, name: t('debug.lastRunTab', { ns: 'workflow' }).toLocaleUpperCase() },
]}
itemClassName="ml-0"
value={value}

View File

@ -118,9 +118,9 @@ const BaseNode: FC<BaseNodeProps> = ({
let text = ''
if (data._runningStatus === NodeRunningStatus.Running)
text = t('workflow.nodes.loop.currentLoopCount', { count: data._loopIndex })
text = t('nodes.loop.currentLoopCount', { ns: 'workflow', count: data._loopIndex })
if (data._runningStatus === NodeRunningStatus.Succeeded || data._runningStatus === NodeRunningStatus.Failed)
text = t('workflow.nodes.loop.totalLoopCount', { count: data._loopIndex })
text = t('nodes.loop.totalLoopCount', { ns: 'workflow', count: data._loopIndex })
if (text) {
return (
@ -167,7 +167,7 @@ const BaseNode: FC<BaseNodeProps> = ({
data.type === BlockEnum.DataSource && (
<div className="absolute inset-[-2px] top-[-22px] z-[-1] rounded-[18px] bg-node-data-source-bg p-0.5 backdrop-blur-[6px]">
<div className="system-2xs-semibold-uppercase flex h-5 items-center px-2.5 text-text-tertiary">
{t('workflow.blocks.datasource')}
{t('blocks.datasource', { ns: 'workflow' })}
</div>
</div>
)
@ -261,14 +261,14 @@ const BaseNode: FC<BaseNodeProps> = ({
<Tooltip popupContent={(
<div className="w-[180px]">
<div className="font-extrabold">
{t('workflow.nodes.iteration.parallelModeEnableTitle')}
{t('nodes.iteration.parallelModeEnableTitle', { ns: 'workflow' })}
</div>
{t('workflow.nodes.iteration.parallelModeEnableDesc')}
{t('nodes.iteration.parallelModeEnableDesc', { ns: 'workflow' })}
</div>
)}
>
<div className="system-2xs-medium-uppercase ml-1 flex items-center justify-center rounded-[5px] border-[1px] border-text-warning px-[5px] py-[3px] text-text-warning ">
{t('workflow.nodes.iteration.parallelModeUpper')}
{t('nodes.iteration.parallelModeUpper', { ns: 'workflow' })}
</div>
</Tooltip>
)