Shun Miyazawa hai 1 ano
pai
achega
5c25150bf8

+ 8 - 4
apps/app/public/static/locales/en_US/translation.json

@@ -511,10 +511,14 @@
     "error_message": "An error has occurred",
     "show_error_detail": "Show error details",
     "preset_prompt": {
-      "summarize": "Summarize this article",
-      "replace": "Replace specific text",
-      "correct": "Correct errors in the text",
-      "create": "Create text"
+      "summarize": {
+        "title": "Summarize this article",
+        "prompt": ""
+      },
+      "correct": {
+        "title": "Correct errors in the text",
+        "prompt": ""
+      }
     }
   },
   "modal_ai_assistant": {

+ 8 - 4
apps/app/public/static/locales/fr_FR/translation.json

@@ -505,10 +505,14 @@
     "error_message": "Erreur",
     "show_error_detail": "Détails de l'exposition",
     "preset_prompt": {
-      "summarize": "Résumer cet article'",
-      "replace": "Remplacer un texte spécifique",
-      "correct": "Corriger les erreurs du texte",
-      "create": "Créer un texte"
+      "summarize": {
+        "title": "Résumer cet article'",
+        "prompt": ""
+      },
+      "correct": {
+        "title": "Corriger les erreurs du texte",
+        "prompt": ""
+      }
     }
   },
   "modal_ai_assistant": {

+ 8 - 4
apps/app/public/static/locales/ja_JP/translation.json

@@ -543,10 +543,14 @@
     "error_message": "エラーが発生しました",
     "show_error_detail": "詳細を表示",
     "preset_prompt": {
-      "summarize": "この記事の要約をつくる",
-      "replace": "特定の文章を要約する",
-      "correct": "文章の誤りを修正する",
-      "create": "文章を作成する"
+      "summarize": {
+        "title": "この記事の要約をつくる",
+        "prompt": ""
+      },
+      "correct": {
+        "title": "文章の誤りを修正する",
+        "prompt": ""
+      }
     }
   },
   "modal_ai_assistant": {

+ 8 - 4
apps/app/public/static/locales/zh_CN/translation.json

@@ -500,10 +500,14 @@
     "error_message": "错误",
     "show_error_detail": "显示详情",
     "preset_prompt": {
-      "summarize": "为此文章创建摘要",
-      "replace": "替换特定文本",
-      "correct": "修正文本中的错误",
-      "create": "创建文本"
+      "summarize": {
+        "title": "为此文章创建摘要",
+        "prompt": ""
+      },
+      "correct": {
+        "title": "修正文本中的错误",
+        "prompt": ""
+      }
     }
   },
   "modal_ai_assistant": {

+ 6 - 6
apps/app/src/features/openai/client/components/AiAssistant/AiAssistantSidebar/PresetPromptList.tsx

@@ -1,3 +1,5 @@
+import { useCallback } from 'react';
+
 import { useTranslation } from 'react-i18next';
 
 type Props = {
@@ -5,10 +7,8 @@ type Props = {
 }
 
 const presetPrompts = [
-  'sidebar_ai_assistant.preset_prompt.summarize',
-  'sidebar_ai_assistant.preset_prompt.replace',
-  'sidebar_ai_assistant.preset_prompt.correct',
-  'sidebar_ai_assistant.preset_prompt.create',
+  'summarize',
+  'correct',
 ];
 
 export const PresetPromptList: React.FC<Props> = () => {
@@ -21,11 +21,11 @@ export const PresetPromptList: React.FC<Props> = () => {
           <button
             type="button"
             key={presetPrompt}
-            className="btn  text-body-secondary p-3 rounded-3 border border-1"
+            className="btn text-body-secondary p-3 rounded-3 border border-1"
           >
             <div className="d-flex align-items-center">
               <span className="material-symbols-outlined fs-5 me-3">lightbulb</span>
-              <span className="fs-6">{t(presetPrompt)}</span>
+              <span className="fs-6">{t(`sidebar_ai_assistant.preset_prompt.${presetPrompt}.title`)}</span>
             </div>
           </button>
         ))}