From 9ef2c1a64cc120a778f24dca8421247b50b5f67c Mon Sep 17 00:00:00 2001 From: jZonG Date: Tue, 22 Apr 2025 17:50:19 +0800 Subject: [PATCH] i18n of variable inspect panel --- .../workflow/variable-inspect/empty.tsx | 9 ++++++--- .../components/workflow/variable-inspect/left.tsx | 15 +++++++++------ .../workflow/variable-inspect/panel.tsx | 5 ++++- web/i18n/en-US/workflow.ts | 8 ++++++++ web/i18n/zh-Hans/workflow.ts | 8 ++++++++ 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/web/app/components/workflow/variable-inspect/empty.tsx b/web/app/components/workflow/variable-inspect/empty.tsx index e0279478df..7cdcdead1a 100644 --- a/web/app/components/workflow/variable-inspect/empty.tsx +++ b/web/app/components/workflow/variable-inspect/empty.tsx @@ -1,16 +1,19 @@ import type { FC } from 'react' +import { useTranslation } from 'react-i18next' import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development' const Empty: FC = () => { + const { t } = useTranslation() + return (
-
Variable Inspect
-
No variables to inspect
- Learn more +
{t('workflow.debug.variableInspect.title')}
+
{t('workflow.debug.variableInspect.emptyTip')}
+ {t('workflow.debug.variableInspect.emptyLink')}
) diff --git a/web/app/components/workflow/variable-inspect/left.tsx b/web/app/components/workflow/variable-inspect/left.tsx index b196f96139..bbb58e0bbb 100644 --- a/web/app/components/workflow/variable-inspect/left.tsx +++ b/web/app/components/workflow/variable-inspect/left.tsx @@ -1,11 +1,12 @@ // import { useState } from 'react' +import { useTranslation } from 'react-i18next' import { RiArrowRightSLine, RiErrorWarningFill, RiLoader2Line, } from '@remixicon/react' - // import { useStore } from '../store' - import { BlockEnum } from '../types' +// import { useStore } from '../store' +import { BlockEnum } from '../types' import Button from '@/app/components/base/button' // import ActionButton from '@/app/components/base/action-button' // import Tooltip from '@/app/components/base/tooltip' @@ -20,6 +21,8 @@ type Props = { } const Left = ({ handleMenuClick }: Props) => { + const { t } = useTranslation() + // const bottomPanelWidth = useStore(s => s.bottomPanelWidth) // const setShowVariableInspectPanel = useStore(s => s.setShowVariableInspectPanel) const { @@ -33,8 +36,8 @@ const Left = ({ handleMenuClick }: Props) => {
{/* header */}
-
Variable inspect
- +
{t('workflow.debug.variableInspect.title')}
+
{/* content */}
@@ -44,7 +47,7 @@ const Left = ({ handleMenuClick }: Props) => {
-
Environment
+
{t('workflow.env.envPanelTitle')}
{/* var item list */} @@ -68,7 +71,7 @@ const Left = ({ handleMenuClick }: Props) => {
-
Conversation
+
{t('workflow.chatVariable.panelTitle')}
{/* var item list */} diff --git a/web/app/components/workflow/variable-inspect/panel.tsx b/web/app/components/workflow/variable-inspect/panel.tsx index 54b9ff9480..fa6ccde169 100644 --- a/web/app/components/workflow/variable-inspect/panel.tsx +++ b/web/app/components/workflow/variable-inspect/panel.tsx @@ -1,5 +1,6 @@ import type { FC } from 'react' import { useState } from 'react' +import { useTranslation } from 'react-i18next' import { RiCloseLine, } from '@remixicon/react' @@ -11,6 +12,8 @@ import ActionButton from '@/app/components/base/action-button' import cn from '@/utils/classnames' const Panel: FC = () => { + const { t } = useTranslation() + const bottomPanelWidth = useStore(s => s.bottomPanelWidth) const setShowVariableInspectPanel = useStore(s => s.setShowVariableInspectPanel) const [showLeftPanel, setShowLeftPanel] = useState(true) @@ -20,7 +23,7 @@ const Panel: FC = () => { return (
-
Variable Inspect
+
{t('workflow.debug.variableInspect.title')}
setShowVariableInspectPanel(false)}> diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts index 8cbfc41f40..923c53b3ea 100644 --- a/web/i18n/en-US/workflow.ts +++ b/web/i18n/en-US/workflow.ts @@ -915,6 +915,14 @@ const translation = { runThisNode: 'Run this node', }, variableInspect: { + title: 'Variable Inspect', + emptyTip: 'After stepping through a node on the canvas or running a node step by step, you can view the current value of the node variable in Variable Inspect', + emptyLink: 'Learn more', + clearAll: 'Clear all', + clearNode: 'Clear cached variable', + view: 'View log', + edited: 'Edited', + reset: 'Reset to last run value', trigger: { normal: 'Variable Inspect', running: 'Caching running status', diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts index 00855f908d..6a4e0324bb 100644 --- a/web/i18n/zh-Hans/workflow.ts +++ b/web/i18n/zh-Hans/workflow.ts @@ -916,6 +916,14 @@ const translation = { runThisNode: '运行此节点', }, variableInspect: { + title: '变量检查', + emptyTip: '在画布上逐步浏览节点或逐步运行节点后,您可以在变量检查中查看节点变量的当前值', + emptyLink: '了解更多', + clearAll: '清除所有', + clearNode: '清除缓存', + view: '查看记录', + edited: '已编辑', + reset: '还原至上一次运行', trigger: { normal: '变量检查', running: '缓存中',