Browse Source

internationalization and add tooltip

Yuki Takei 1 year ago
parent
commit
7d82a195a4

+ 2 - 0
apps/app/public/static/locales/en_US/translation.json

@@ -489,6 +489,8 @@
     "title": "Knowledge Assistant",
     "title_beta_label": "(Beta)",
     "placeholder": "Ask me anything.",
+    "summary_mode_label": "Summary mode",
+    "summary_mode_help": "Concise answer within 2-3 sentences",
     "caution_against_hallucination": "Please verify the information and check the sources.",
     "progress_label": "Generating answers",
     "failed_to_create_or_retrieve_thread": "Failed to create or retrieve thread",

+ 2 - 0
apps/app/public/static/locales/fr_FR/translation.json

@@ -483,6 +483,8 @@
     "title": "Assistant de Connaissance",
     "title_beta_label": "(Bêta)",
     "placeholder": "Demandez-moi n'importe quoi.",
+    "summary_mode_label": "Mode résumé",
+    "summary_mode_help": "Réponse concise en 2-3 phrases",
     "caution_against_hallucination": "Veuillez vérifier les informations et consulter les sources.",
     "progress_label": "Génération des réponses",
     "failed_to_create_or_retrieve_thread": "Échec de la création ou de la récupération du fil de discussion",

+ 2 - 0
apps/app/public/static/locales/ja_JP/translation.json

@@ -522,6 +522,8 @@
     "title": "ナレッジアシスタント",
     "title_beta_label": "(ベータ)",
     "placeholder": "ききたいことを入力してください",
+    "summary_mode_label": "要約モード",
+    "summary_mode_help": "2~3文以内の簡潔な回答",
     "caution_against_hallucination": "情報が正しいか出典を確認しましょう",
     "progress_label": "回答を生成しています",
     "failed_to_create_or_retrieve_thread": "スレッドの作成または取得に失敗しました",

+ 2 - 0
apps/app/public/static/locales/zh_CN/translation.json

@@ -478,6 +478,8 @@
     "title": "知识助手",
     "title_beta_label": "(测试版)",
     "placeholder": "问我任何问题。",
+    "summary_mode_label": "摘要模式",
+    "summary_mode_help": "简洁回答在2-3句话内",
     "caution_against_hallucination": "请核实信息并检查来源。",
     "progress_label": "生成答案中",
     "failed_to_create_or_retrieve_thread": "创建或获取线程失败",

+ 18 - 1
apps/app/src/features/openai/chat/components/AiChatModal/AiChatModal.tsx

@@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next';
 import {
   Collapse,
   Modal, ModalBody, ModalFooter, ModalHeader,
+  UncontrolledTooltip,
 } from 'reactstrap';
 
 import { apiv3Post } from '~/client/util/apiv3-client';
@@ -251,7 +252,23 @@ const AiChatModalSubstance = (): JSX.Element => {
               {...form.register('summaryMode')}
               disabled={form.formState.isSubmitting || isGenerating}
             />
-            <label className="form-check-label" htmlFor="swSummaryMode">Summary Mode</label>
+            <label className="form-check-label" htmlFor="swSummaryMode">
+              {t('modal_aichat.summary_mode_label')}
+            </label>
+
+            {/* Help */}
+            <a
+              id="tooltipForHelpOfSummaryMode"
+              role="button"
+              className="ms-1"
+            >
+              <span className="material-symbols-outlined fs-6" style={{ lineHeight: 'unset' }}>help</span>
+            </a>
+            <UncontrolledTooltip
+              target="tooltipForHelpOfSummaryMode"
+            >
+              {t('modal_aichat.summary_mode_help')}
+            </UncontrolledTooltip>
           </div>
         </form>