balibabu commited on
Commit
fbb1e63
·
1 Parent(s): b25a0c6

feat: translate text from DuckDuckGo #918 (#1486)

Browse files

### 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 CHANGED
@@ -606,7 +606,9 @@ The above is the content you need to summarize.`,
606
  duckDuckGoDescription:
607
  '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.',
608
  channel: 'Channel',
609
- channelTip: 'channelTip',
 
 
610
  },
611
  footer: {
612
  profile: 'All rights reserved @ React',
 
606
  duckDuckGoDescription:
607
  '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.',
608
  channel: 'Channel',
609
+ channelTip: `Perform text search or news search on the component's input`,
610
+ text: 'Text',
611
+ news: 'News',
612
  },
613
  footer: {
614
  profile: 'All rights reserved @ React',
web/src/locales/zh-traditional.ts CHANGED
@@ -559,6 +559,17 @@ export default {
559
  addItem: '新增',
560
  nameRequiredMsg: '名稱不能為空',
561
  nameRepeatedMsg: '名稱不能重複',
 
 
 
 
 
 
 
 
 
 
 
562
  },
563
  footer: {
564
  profile: '“保留所有權利 @ react”',
 
559
  addItem: '新增',
560
  nameRequiredMsg: '名稱不能為空',
561
  nameRepeatedMsg: '名稱不能重複',
562
+ keywordExtract: '關鍵字',
563
+ keywordExtractDescription: `該組件用於從用戶的問題中提取關鍵字。 Top N指定需要提取的關鍵字數量。`,
564
+ baidu: '百度',
565
+ baiduDescription: `此組件用於取得www.baidu.com的搜尋結果,一般作為知識庫的補充,Top N指定需要採納的搜尋結果數。`,
566
+ duckDuckGo: 'DuckDuckGo',
567
+ duckDuckGoDescription:
568
+ '此元件用於從 www.duckduckgo.com 取得搜尋結果。通常,它作為知識庫的補充。 Top N 指定您需要採用的搜尋結果數。',
569
+ channel: '頻道',
570
+ channelTip: '針對該組件的輸入進行文字搜尋或新聞搜索',
571
+ text: '文字',
572
+ news: '新聞',
573
  },
574
  footer: {
575
  profile: '“保留所有權利 @ react”',
web/src/locales/zh.ts CHANGED
@@ -577,6 +577,17 @@ export default {
577
  addItem: '新增',
578
  nameRequiredMsg: '名称不能为空',
579
  nameRepeatedMsg: '名称不能重复',
 
 
 
 
 
 
 
 
 
 
 
580
  },
581
  footer: {
582
  profile: 'All rights reserved @ React',
 
577
  addItem: '新增',
578
  nameRequiredMsg: '名称不能为空',
579
  nameRepeatedMsg: '名称不能重复',
580
+ keywordExtract: '关键词',
581
+ keywordExtractDescription: `该组件用于从用户的问题中提取关键词。Top N指定需要提取的关键词数量。`,
582
+ baidu: '百度',
583
+ baiduDescription: `该组件用于获取www.baidu.com的搜索结果,一般作为知识库的补充,Top N指定需要采纳的搜索结果数量。`,
584
+ duckDuckGo: 'DuckDuckGo',
585
+ duckDuckGoDescription:
586
+ '此组件用于从 www.duckduckgo.com 获取搜索结果。通常,它作为知识库的补充。Top N 指定您需要采用的搜索结果数量。',
587
+ channel: '频道',
588
+ channelTip: '针对该组件的输入进行文本搜索或新闻搜索',
589
+ text: '文本',
590
+ news: '新闻',
591
  },
592
  footer: {
593
  profile: 'All rights reserved @ React',
web/src/pages/flow/duckduckgo-form/index.tsx CHANGED
@@ -1,6 +1,6 @@
1
  import TopNItem from '@/components/top-n-item';
2
  import { useTranslate } from '@/hooks/commonHooks';
3
- import { Form, Input } from 'antd';
4
  import { IOperatorForm } from '../interface';
5
 
6
  const DuckDuckGoForm = ({ onValuesChange, form }: IOperatorForm) => {
@@ -20,8 +20,14 @@ const DuckDuckGoForm = ({ onValuesChange, form }: IOperatorForm) => {
20
  label={t('channel')}
21
  name={'channel'}
22
  tooltip={t('channelTip')}
 
23
  >
24
- <Input.TextArea rows={5} />
 
 
 
 
 
25
  </Form.Item>
26
  </Form>
27
  );
 
1
  import TopNItem from '@/components/top-n-item';
2
  import { useTranslate } from '@/hooks/commonHooks';
3
+ import { Form, Select } from 'antd';
4
  import { IOperatorForm } from '../interface';
5
 
6
  const DuckDuckGoForm = ({ onValuesChange, form }: IOperatorForm) => {
 
20
  label={t('channel')}
21
  name={'channel'}
22
  tooltip={t('channelTip')}
23
+ initialValue={'text'}
24
  >
25
+ <Select
26
+ options={[
27
+ { value: 'text', label: t('text') },
28
+ { value: 'news', label: t('news') },
29
+ ]}
30
+ ></Select>
31
  </Form.Item>
32
  </Form>
33
  );