From 740714b79dbe75ae5768073aee9258217ee9531d Mon Sep 17 00:00:00 2001 From: balibabu Date: Fri, 12 Jul 2024 15:22:36 +0800 Subject: [PATCH] feat: translate text from DuckDuckGo #918 (#1486) ### What problem does this PR solve? feat: translate text from DuckDuckGo #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- web/src/locales/en.ts | 4 +++- web/src/locales/zh-traditional.ts | 11 +++++++++++ web/src/locales/zh.ts | 11 +++++++++++ web/src/pages/flow/duckduckgo-form/index.tsx | 10 ++++++++-- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts index 7fe91112e..10b98eb40 100644 --- a/web/src/locales/en.ts +++ b/web/src/locales/en.ts @@ -606,7 +606,9 @@ The above is the content you need to summarize.`, duckDuckGoDescription: 'This component is used to get search result from www.duckduckgo.com. Typically, it performs as a supplement to knowledgebases. Top N specifies the number of search results you need to adopt.', channel: 'Channel', - channelTip: 'channelTip', + channelTip: `Perform text search or news search on the component's input`, + text: 'Text', + news: 'News', }, footer: { profile: 'All rights reserved @ React', diff --git a/web/src/locales/zh-traditional.ts b/web/src/locales/zh-traditional.ts index e8b56ba7a..2a5bd7444 100644 --- a/web/src/locales/zh-traditional.ts +++ b/web/src/locales/zh-traditional.ts @@ -559,6 +559,17 @@ export default { addItem: '新增', nameRequiredMsg: '名稱不能為空', nameRepeatedMsg: '名稱不能重複', + keywordExtract: '關鍵字', + keywordExtractDescription: `該組件用於從用戶的問題中提取關鍵字。 Top N指定需要提取的關鍵字數量。`, + baidu: '百度', + baiduDescription: `此組件用於取得www.baidu.com的搜尋結果,一般作為知識庫的補充,Top N指定需要採納的搜尋結果數。`, + duckDuckGo: 'DuckDuckGo', + duckDuckGoDescription: + '此元件用於從 www.duckduckgo.com 取得搜尋結果。通常,它作為知識庫的補充。 Top N 指定您需要採用的搜尋結果數。', + channel: '頻道', + channelTip: '針對該組件的輸入進行文字搜尋或新聞搜索', + text: '文字', + news: '新聞', }, footer: { profile: '“保留所有權利 @ react”', diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts index 287c0c0c1..577b4c365 100644 --- a/web/src/locales/zh.ts +++ b/web/src/locales/zh.ts @@ -577,6 +577,17 @@ export default { addItem: '新增', nameRequiredMsg: '名称不能为空', nameRepeatedMsg: '名称不能重复', + keywordExtract: '关键词', + keywordExtractDescription: `该组件用于从用户的问题中提取关键词。Top N指定需要提取的关键词数量。`, + baidu: '百度', + baiduDescription: `该组件用于获取www.baidu.com的搜索结果,一般作为知识库的补充,Top N指定需要采纳的搜索结果数量。`, + duckDuckGo: 'DuckDuckGo', + duckDuckGoDescription: + '此组件用于从 www.duckduckgo.com 获取搜索结果。通常,它作为知识库的补充。Top N 指定您需要采用的搜索结果数量。', + channel: '频道', + channelTip: '针对该组件的输入进行文本搜索或新闻搜索', + text: '文本', + news: '新闻', }, footer: { profile: 'All rights reserved @ React', diff --git a/web/src/pages/flow/duckduckgo-form/index.tsx b/web/src/pages/flow/duckduckgo-form/index.tsx index 7720a6b7b..685c54e7a 100644 --- a/web/src/pages/flow/duckduckgo-form/index.tsx +++ b/web/src/pages/flow/duckduckgo-form/index.tsx @@ -1,6 +1,6 @@ import TopNItem from '@/components/top-n-item'; import { useTranslate } from '@/hooks/commonHooks'; -import { Form, Input } from 'antd'; +import { Form, Select } from 'antd'; import { IOperatorForm } from '../interface'; const DuckDuckGoForm = ({ onValuesChange, form }: IOperatorForm) => { @@ -20,8 +20,14 @@ const DuckDuckGoForm = ({ onValuesChange, form }: IOperatorForm) => { label={t('channel')} name={'channel'} tooltip={t('channelTip')} + initialValue={'text'} > - + );