mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-06-04 11:24:00 +08:00
### What problem does this PR solve? feat: translate name of operator #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
56e3fa2d6a
commit
198a8b6592
@ -1,4 +1,3 @@
|
|||||||
import { useTranslate } from '@/hooks/commonHooks';
|
|
||||||
import { ResponseType } from '@/interfaces/database/base';
|
import { ResponseType } from '@/interfaces/database/base';
|
||||||
import { DSL, IFlow, IFlowTemplate } from '@/interfaces/database/flow';
|
import { DSL, IFlow, IFlowTemplate } from '@/interfaces/database/flow';
|
||||||
import i18n from '@/locales/config';
|
import i18n from '@/locales/config';
|
||||||
@ -46,7 +45,6 @@ export const EmptyDsl = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const useFetchFlowTemplates = (): ResponseType<IFlowTemplate[]> => {
|
export const useFetchFlowTemplates = (): ResponseType<IFlowTemplate[]> => {
|
||||||
const { t } = useTranslate('flow');
|
|
||||||
const { data } = useQuery({
|
const { data } = useQuery({
|
||||||
queryKey: ['fetchFlowTemplates'],
|
queryKey: ['fetchFlowTemplates'],
|
||||||
initialData: [],
|
initialData: [],
|
||||||
@ -55,8 +53,8 @@ export const useFetchFlowTemplates = (): ResponseType<IFlowTemplate[]> => {
|
|||||||
if (Array.isArray(data?.data)) {
|
if (Array.isArray(data?.data)) {
|
||||||
data.data.unshift({
|
data.data.unshift({
|
||||||
id: uuid(),
|
id: uuid(),
|
||||||
title: t('blank'),
|
title: 'Blank',
|
||||||
description: t('createFromNothing'),
|
description: 'Create from nothing',
|
||||||
dsl: EmptyDsl,
|
dsl: EmptyDsl,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -554,7 +554,7 @@ The above is the content you need to summarize.`,
|
|||||||
description: 'Description',
|
description: 'Description',
|
||||||
examples: 'Examples',
|
examples: 'Examples',
|
||||||
to: 'To',
|
to: 'To',
|
||||||
message: 'Messages',
|
msg: 'Messages',
|
||||||
messagePlaceholder: 'message',
|
messagePlaceholder: 'message',
|
||||||
messageMsg: 'Please input message or delete this field.',
|
messageMsg: 'Please input message or delete this field.',
|
||||||
addField: 'Add field',
|
addField: 'Add field',
|
||||||
@ -591,9 +591,11 @@ The above is the content you need to summarize.`,
|
|||||||
relevant: 'Relevant',
|
relevant: 'Relevant',
|
||||||
rewriteQuestion: 'RewriteQuestion',
|
rewriteQuestion: 'RewriteQuestion',
|
||||||
rewrite: 'Rewrite',
|
rewrite: 'Rewrite',
|
||||||
Begin: 'Begin',
|
begin: 'Begin',
|
||||||
|
message: 'Message',
|
||||||
blank: 'Blank',
|
blank: 'Blank',
|
||||||
createFromNothing: 'Create from nothing',
|
createFromNothing: 'Create from nothing',
|
||||||
|
addItem: 'Add Item',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
profile: 'All rights reserved @ React',
|
profile: 'All rights reserved @ React',
|
||||||
|
@ -515,7 +515,7 @@ export default {
|
|||||||
description: '描述',
|
description: '描述',
|
||||||
examples: '範例',
|
examples: '範例',
|
||||||
to: '下一步',
|
to: '下一步',
|
||||||
message: '訊息',
|
msg: '訊息',
|
||||||
messagePlaceholder: '訊息',
|
messagePlaceholder: '訊息',
|
||||||
messageMsg: '請輸入訊息或刪除此欄位。',
|
messageMsg: '請輸入訊息或刪除此欄位。',
|
||||||
addField: '新增字段',
|
addField: '新增字段',
|
||||||
@ -546,16 +546,17 @@ export default {
|
|||||||
以上就是你需要總結的內容。`,
|
以上就是你需要總結的內容。`,
|
||||||
createGraph: '建立圖表',
|
createGraph: '建立圖表',
|
||||||
createFromTemplates: '從模板創建',
|
createFromTemplates: '從模板創建',
|
||||||
retrieval: '檢索',
|
retrieval: '知識檢索',
|
||||||
generate: '產生',
|
generate: '生成回答',
|
||||||
answer: '回答',
|
answer: '人機交互',
|
||||||
categorize: '分類',
|
categorize: '問題分類',
|
||||||
relevant: '相關',
|
relevant: '是否相關',
|
||||||
rewriteQuestion: '重組',
|
rewriteQuestion: '問題最佳化',
|
||||||
rewrite: '重組',
|
|
||||||
begin: '開始',
|
begin: '開始',
|
||||||
|
message: '靜態訊息',
|
||||||
blank: '空',
|
blank: '空',
|
||||||
createFromNothing: '從無到有',
|
createFromNothing: '從無到有',
|
||||||
|
addItem: '新增',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
profile: '“保留所有權利 @ react”',
|
profile: '“保留所有權利 @ react”',
|
||||||
|
@ -534,7 +534,7 @@ export default {
|
|||||||
description: '描述',
|
description: '描述',
|
||||||
examples: '示例',
|
examples: '示例',
|
||||||
to: '下一步',
|
to: '下一步',
|
||||||
message: '消息',
|
msg: '消息',
|
||||||
messagePlaceholder: '消息',
|
messagePlaceholder: '消息',
|
||||||
messageMsg: '请输入消息或删除此字段。',
|
messageMsg: '请输入消息或删除此字段。',
|
||||||
addField: '新增字段',
|
addField: '新增字段',
|
||||||
@ -564,16 +564,17 @@ export default {
|
|||||||
以上就是你需要总结的内容。`,
|
以上就是你需要总结的内容。`,
|
||||||
createGraph: '创建图表',
|
createGraph: '创建图表',
|
||||||
createFromTemplates: '从模板创建',
|
createFromTemplates: '从模板创建',
|
||||||
retrieval: '检索',
|
retrieval: '知识检索',
|
||||||
generate: '生成',
|
generate: '生成回答',
|
||||||
answer: '回答',
|
answer: '人机交互',
|
||||||
categorize: '分类',
|
categorize: '问题分类',
|
||||||
relevant: '相关',
|
relevant: '是否相关',
|
||||||
rewriteQuestion: '重组',
|
rewriteQuestion: '问题优化',
|
||||||
rewrite: '重组',
|
|
||||||
begin: '开始',
|
begin: '开始',
|
||||||
|
message: '静态消息',
|
||||||
blank: '空',
|
blank: '空',
|
||||||
createFromNothing: '从无到有',
|
createFromNothing: '从无到有',
|
||||||
|
addItem: '新增',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
profile: 'All rights reserved @ React',
|
profile: 'All rights reserved @ React',
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import { Handle, Position } from 'reactflow';
|
import { Handle, Position } from 'reactflow';
|
||||||
// import { v4 as uuid } from 'uuid';
|
// import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
import { useTranslate } from '@/hooks/commonHooks';
|
|
||||||
import lowerFirst from 'lodash/lowerFirst';
|
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
const DEFAULT_HANDLE_STYLE = {
|
const DEFAULT_HANDLE_STYLE = {
|
||||||
@ -20,7 +18,6 @@ interface IProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const CategorizeHandle = ({ top, right, text, idx }: IProps) => {
|
const CategorizeHandle = ({ top, right, text, idx }: IProps) => {
|
||||||
const { t } = useTranslate('flow');
|
|
||||||
return (
|
return (
|
||||||
<Handle
|
<Handle
|
||||||
type="source"
|
type="source"
|
||||||
@ -36,9 +33,7 @@ const CategorizeHandle = ({ top, right, text, idx }: IProps) => {
|
|||||||
color: 'black',
|
color: 'black',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span className={styles.categorizeAnchorPointText}>
|
<span className={styles.categorizeAnchorPointText}>{text}</span>
|
||||||
{lowerFirst(t(text))}
|
|
||||||
</span>
|
|
||||||
</Handle>
|
</Handle>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -88,7 +88,7 @@ const DynamicCategorize = ({ nodeId }: IProps) => {
|
|||||||
))}
|
))}
|
||||||
|
|
||||||
<Button type="dashed" onClick={handleAdd} block>
|
<Button type="dashed" onClick={handleAdd} block>
|
||||||
+ Add Item
|
+ {t('addItem')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -38,7 +38,7 @@ const MessageForm = ({ onValuesChange, form }: IOperatorForm) => {
|
|||||||
{fields.map((field, index) => (
|
{fields.map((field, index) => (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
{...(index === 0 ? formItemLayout : formItemLayoutWithOutLabel)}
|
{...(index === 0 ? formItemLayout : formItemLayoutWithOutLabel)}
|
||||||
label={index === 0 ? t('message') : ''}
|
label={index === 0 ? t('msg') : ''}
|
||||||
required={false}
|
required={false}
|
||||||
key={field.key}
|
key={field.key}
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user