chore: add i18n

pull/12372/head
AkaraChen 1 year ago
parent e1d0c29711
commit ac2c8344f2

@ -48,6 +48,7 @@ export const AgentStrategySelector = (props: AgentStrategySelectorProps) => {
}, [query, list.data]) }, [query, list.data])
// TODO: should be replaced by real data // TODO: should be replaced by real data
const isExternalInstalled = true const isExternalInstalled = true
const { t } = useTranslation()
return <PortalToFollowElem open={open} onOpenChange={setOpen} placement='bottom'> return <PortalToFollowElem open={open} onOpenChange={setOpen} placement='bottom'>
<PortalToFollowElemTrigger className='w-full'> <PortalToFollowElemTrigger className='w-full'>
<div className='py-2 pl-3 pr-2 flex items-center rounded-lg bg-components-input-bg-normal w-full hover:bg-state-base-hover-alt select-none' onClick={() => setOpen(o => !o)}> <div className='py-2 pl-3 pr-2 flex items-center rounded-lg bg-components-input-bg-normal w-full hover:bg-state-base-hover-alt select-none' onClick={() => setOpen(o => !o)}>
@ -64,7 +65,7 @@ export const AgentStrategySelector = (props: AgentStrategySelectorProps) => {
<p <p
className={classNames(value ? 'text-components-input-text-filled' : 'text-components-input-text-placeholder', 'text-xs px-1')} className={classNames(value ? 'text-components-input-text-filled' : 'text-components-input-text-placeholder', 'text-xs px-1')}
> >
{value?.agent_strategy_name || 'Select agentic strategy'} {value?.agent_strategy_name || t('workflow.nodes.agent.strategy.selectTip')}
</p> </p>
{value && <div className='ml-auto flex items-center gap-1'> {value && <div className='ml-auto flex items-center gap-1'>
<InstallPluginButton onClick={e => e.stopPropagation()} size={'small'} /> <InstallPluginButton onClick={e => e.stopPropagation()} size={'small'} />

@ -6,18 +6,20 @@ import ModelSelector from '@/app/components/header/account-setting/model-provide
import { Group, GroupLabel } from '../_base/components/group' import { Group, GroupLabel } from '../_base/components/group'
import { ToolIcon } from './components/tool-icon' import { ToolIcon } from './components/tool-icon'
import useConfig from './use-config' import useConfig from './use-config'
import { useTranslation } from 'react-i18next'
const AgentNode: FC<NodeProps<AgentNodeType>> = (props) => { const AgentNode: FC<NodeProps<AgentNodeType>> = (props) => {
const { inputs } = useConfig(props.id, props.data) const { inputs } = useConfig(props.id, props.data)
const { t } = useTranslation()
return <div className='mb-1 px-3 py-1 space-y-1'> return <div className='mb-1 px-3 py-1 space-y-1'>
{inputs.agent_strategy_name {inputs.agent_strategy_name
? <SettingItem label='Strategy' status='error' tooltip='ReAct is not installed'> ? <SettingItem label='Strategy' status='error' tooltip='ReAct is not installed'>
{inputs.agent_strategy_name} {inputs.agent_strategy_name}
</SettingItem> </SettingItem>
: <SettingItem label='Agentic strategy Not Set' />} : <SettingItem label={t('workflow.nodes.agent.strategyNotSet')} />}
<Group <Group
label={<GroupLabel className='mt-1'> label={<GroupLabel className='mt-1'>
Model {t('workflow.nodes.agent.model')}
</GroupLabel>} </GroupLabel>}
> >
<ModelSelector <ModelSelector
@ -34,7 +36,7 @@ const AgentNode: FC<NodeProps<AgentNodeType>> = (props) => {
/> />
</Group> </Group>
<Group label={<GroupLabel className='mt-1'> <Group label={<GroupLabel className='mt-1'>
Toolbox {t('workflow.nodes.agent.toolbox')}
</GroupLabel>}> </GroupLabel>}>
<div className='grid grid-cols-10 gap-0.5'> <div className='grid grid-cols-10 gap-0.5'>
<ToolIcon src='/logo/logo.png' /> <ToolIcon src='/logo/logo.png' />

@ -699,8 +699,10 @@ const translation = {
}, },
agent: { agent: {
strategy: { strategy: {
label: 'Agentic Strategy',
configureTip: 'Please configure agentic strategy.', configureTip: 'Please configure agentic strategy.',
configureTipDesc: 'After configuring the agentic strategy, this node will automatically load the remaining configurations. The strategy will affect the mechanism of multi-step tool reasoning. ', configureTipDesc: 'After configuring the agentic strategy, this node will automatically load the remaining configurations. The strategy will affect the mechanism of multi-step tool reasoning. ',
selectTip: 'Select agentic strategy',
}, },
learnMore: 'Learn more', learnMore: 'Learn more',
pluginNotInstalled: 'This plugin is not installed', pluginNotInstalled: 'This plugin is not installed',
@ -710,6 +712,9 @@ const translation = {
install: 'Install', install: 'Install',
installing: 'Installing', installing: 'Installing',
}, },
model: 'model',
toolbox: 'toolbox',
strategyNotSet: 'Agentic strategy Not Set',
}, },
}, },
tracing: { tracing: {

@ -699,8 +699,10 @@ const translation = {
}, },
agent: { agent: {
strategy: { strategy: {
label: 'Agent 策略',
configureTip: '请配置 Agent 策略。', configureTip: '请配置 Agent 策略。',
configureTipDesc: '配置完成后,此节点将自动加载剩余配置。策略将影响多步工具推理的机制。', configureTipDesc: '配置完成后,此节点将自动加载剩余配置。策略将影响多步工具推理的机制。',
selectTip: '选择 Agent 策略',
}, },
learnMore: '了解更多', learnMore: '了解更多',
pluginNotInstalled: '插件未安装', pluginNotInstalled: '插件未安装',
@ -710,6 +712,9 @@ const translation = {
install: '安装', install: '安装',
installing: '安装中', installing: '安装中',
}, },
model: '模型',
toolbox: '工具箱',
strategyNotSet: '代理策略未设置',
}, },
}, },
tracing: { tracing: {

Loading…
Cancel
Save