feat: translate graph #918 (#1411)

### What problem does this PR solve?

feat: translate graph #918 

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-07-08 10:55:10 +08:00
committed by GitHub
parent e3f5464457
commit 1cff117dc9
4 changed files with 50 additions and 25 deletions

View File

@ -1,10 +1,9 @@
import { Button, Flex, Space } from 'antd';
import { useTranslate } from '@/hooks/commonHooks';
import { useFetchFlow } from '@/hooks/flow-hooks';
import { ArrowLeftOutlined } from '@ant-design/icons';
import { Button, Flex, Space } from 'antd';
import { Link } from 'umi';
import { useSaveGraph, useSaveGraphBeforeOpeningDebugDrawer } from '../hooks';
import styles from './index.less';
interface IProps {
@ -15,6 +14,7 @@ const FlowHeader = ({ showChatDrawer }: IProps) => {
const { saveGraph } = useSaveGraph();
const handleRun = useSaveGraphBeforeOpeningDebugDrawer(showChatDrawer);
const { data } = useFetchFlow();
const { t } = useTranslate('flow');
return (
<>
@ -32,10 +32,10 @@ const FlowHeader = ({ showChatDrawer }: IProps) => {
</Space>
<Space size={'large'}>
<Button onClick={handleRun}>
<b>Run</b>
<b>{t('run')}</b>
</Button>
<Button type="primary" onClick={saveGraph}>
<b>Save</b>
<b>{t('save')}</b>
</Button>
</Space>
</Flex>