Просмотр исходного кода

Improve i18n for AiAssistantManagementEditPages

Shun Miyazawa 1 год назад
Родитель
Сommit
bc5c662958

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

@@ -504,6 +504,7 @@
     "show_error_detail": "Show error details"
     "show_error_detail": "Show error details"
   },
   },
   "modal_ai_assistant": {
   "modal_ai_assistant": {
+    "edit_page_description": "Edit pages that the assistant can reference.<br> The assistant can reference up to {{limitLearnablePageCount}} pages including child pages.",
     "default_instruction": "You are the knowledge assistant for this Wiki. Please provide support according to the following guidelines:\n\n- Analyze document relevance and connect information\n- Suggest new perspectives\n- Provide accurate information based on understanding the intent of questions\nI will provide information in a structured format when necessary.",
     "default_instruction": "You are the knowledge assistant for this Wiki. Please provide support according to the following guidelines:\n\n- Analyze document relevance and connect information\n- Suggest new perspectives\n- Provide accurate information based on understanding the intent of questions\nI will provide information in a structured format when necessary.",
     "page_mode_title": {
     "page_mode_title": {
       "share": "Assistant Sharing",
       "share": "Assistant Sharing",

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

@@ -499,6 +499,7 @@
     "show_error_detail": "Détails de l'exposition"
     "show_error_detail": "Détails de l'exposition"
   },
   },
   "modal_ai_assistant": {
   "modal_ai_assistant": {
+    "edit_page_description": "Modifier les pages que l'assistant peut référencer.<br> L'assistant peut référencer jusqu'à {{limitLearnablePageCount}} pages, y compris les pages enfants.",
     "default_instruction": "Vous êtes l'assistant de connaissances pour ce Wiki. Veuillez fournir un support selon les directives suivantes :\n\n- Analyser la pertinence des documents et relier les informations\n- Proposer de nouvelles perspectives\n- Fournir des informations précises en comprenant l'intention des questions\nJe fournirai les informations sous forme structurée si nécessaire.",
     "default_instruction": "Vous êtes l'assistant de connaissances pour ce Wiki. Veuillez fournir un support selon les directives suivantes :\n\n- Analyser la pertinence des documents et relier les informations\n- Proposer de nouvelles perspectives\n- Fournir des informations précises en comprenant l'intention des questions\nJe fournirai les informations sous forme structurée si nécessaire.",
     "page_mode_title": {
     "page_mode_title": {
       "share": "Partage de l'assistant",
       "share": "Partage de l'assistant",

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

@@ -538,6 +538,7 @@
   },
   },
   "modal_ai_assistant": {
   "modal_ai_assistant": {
     "default_instruction": "あなたはこのWikiの知識アシスタントです。以下の方針で支援を行ってください:\n\n- 文書の関連性分析と情報の関連付け\n- 新しい視点の提案\n- 質問の意図を理解した的確な情報提供 必要に応じて構造化された形式で情報を提供します。",
     "default_instruction": "あなたはこのWikiの知識アシスタントです。以下の方針で支援を行ってください:\n\n- 文書の関連性分析と情報の関連付け\n- 新しい視点の提案\n- 質問の意図を理解した的確な情報提供 必要に応じて構造化された形式で情報を提供します。",
+    "edit_page_description": " アシスタントが参照するページを編集します。<br> 参照できるページは配下ページも含めて {{limitLearnablePageCount}} ページまでです。",
     "page_mode_title": {
     "page_mode_title": {
       "share": "アシスタントの共有",
       "share": "アシスタントの共有",
       "pages": "参照ページ",
       "pages": "参照ページ",

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

@@ -494,6 +494,7 @@
     "show_error_detail": "显示详情"
     "show_error_detail": "显示详情"
   },
   },
   "modal_ai_assistant": {
   "modal_ai_assistant": {
+    "edit_page_description": "编辑助手可以参考的页面。<br> 助手可以参考最多 {{limitLearnablePageCount}} 个页面,包括子页面。",
     "default_instruction": "您是这个Wiki的知识助手。请按照以下方针提供支持:\n\n- 分析文档相关性并连接信息\n- 提出新的观点\n- 理解问题意图并提供准确信息\n必要时我会以结构化的形式提供信息。",
     "default_instruction": "您是这个Wiki的知识助手。请按照以下方针提供支持:\n\n- 分析文档相关性并连接信息\n- 提出新的观点\n- 理解问题意图并提供准确信息\n必要时我会以结构化的形式提供信息。",
     "page_mode_title": {
     "page_mode_title": {
       "share": "助理共享",
       "share": "助理共享",

+ 9 - 4
apps/app/src/features/openai/client/components/AiAssistant/AiAssistantManagementModal/AiAssistantManagementEditPages.tsx

@@ -1,10 +1,12 @@
 import React, { useCallback } from 'react';
 import React, { useCallback } from 'react';
 
 
+import { useTranslation } from 'react-i18next';
 import { ModalBody } from 'reactstrap';
 import { ModalBody } from 'reactstrap';
 
 
 import type { IPageForItem } from '~/interfaces/page';
 import type { IPageForItem } from '~/interfaces/page';
 import { usePageSelectModal } from '~/stores/modal';
 import { usePageSelectModal } from '~/stores/modal';
 
 
+import { LIMIT_LEARNABLE_PAGE_COUNT } from '../../../../interfaces/ai-assistant';
 import type { SelectedPage } from '../../../../interfaces/selected-page';
 import type { SelectedPage } from '../../../../interfaces/selected-page';
 
 
 import { AiAssistantManagementHeader } from './AiAssistantManagementHeader';
 import { AiAssistantManagementHeader } from './AiAssistantManagementHeader';
@@ -18,6 +20,8 @@ type Props = {
 }
 }
 
 
 export const AiAssistantManagementEditPages = (props: Props): JSX.Element => {
 export const AiAssistantManagementEditPages = (props: Props): JSX.Element => {
+  const { t } = useTranslation();
+
   const { selectedPages, onSelect, onRemove } = props;
   const { selectedPages, onSelect, onRemove } = props;
 
 
   const { open: openPageSelectModal } = usePageSelectModal();
   const { open: openPageSelectModal } = usePageSelectModal();
@@ -31,10 +35,11 @@ export const AiAssistantManagementEditPages = (props: Props): JSX.Element => {
       <AiAssistantManagementHeader />
       <AiAssistantManagementHeader />
 
 
       <ModalBody className="px-4">
       <ModalBody className="px-4">
-        <p className="text-secondary py-1">
-          アシスタントが参照するページを編集します。<br />
-          参照できるページは配下ページも含めて200ページまでです。
-        </p>
+        <p
+          className="text-secondary py-1"
+          // eslint-disable-next-line react/no-danger
+          dangerouslySetInnerHTML={{ __html: t('modal_ai_assistant.edit_page_description', { limitLearnablePageCount: LIMIT_LEARNABLE_PAGE_COUNT }) }}
+        />
 
 
         <button
         <button
           type="button"
           type="button"