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

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

@@ -511,7 +511,7 @@
     "error_message": "An error has occurred",
     "show_error_detail": "Show error details",
     "discard": "Discard",
-    "adopt": "Adopt",
+    "accept": "Accept",
     "preset_menu": {
       "summarize": {
         "title": "Summarize this article",

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

@@ -505,7 +505,7 @@
     "error_message": "Erreur",
     "show_error_detail": "Détails de l'exposition",
     "discard": "Annuler",
-    "adopt": "Adopter",
+    "accept": "Accepter",
     "preset_menu": {
       "summarize": {
         "title": "Résumer cet article'",

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

@@ -543,7 +543,7 @@
     "error_message": "エラーが発生しました",
     "show_error_detail": "詳細を表示",
     "discard": "破棄",
-    "adopt": "採用",
+    "accept": "採用",
     "preset_menu": {
       "summarize": {
         "title": "この記事の要約をつくる",

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

@@ -500,7 +500,7 @@
     "error_message": "错误",
     "show_error_detail": "显示详情",
     "discard": "丢弃",
-    "adopt": "采纳",
+    "accept": "接受",
     "preset_menu": {
       "summarize": {
         "title": "为此文章创建摘要",

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

@@ -303,7 +303,7 @@ const AiAssistantSidebarSubstance: React.FC<AiAssistantSidebarSubstanceProps> =
     await submit({ input: quickMenu });
   }, [submit]);
 
-  const clickAdoptHandler = useCallback(() => {
+  const clickAcceptHandler = useCallback(() => {
     // todo: implement
   }, []);
 
@@ -337,7 +337,7 @@ const AiAssistantSidebarSubstance: React.FC<AiAssistantSidebarSubstanceProps> =
                     key={message.id}
                     role={message.isUserMessage ? 'user' : 'assistant'}
                     showActionButtons={isEditorAssistant}
-                    onAdopt={clickAdoptHandler}
+                    onAccept={clickAcceptHandler}
                     onDiscard={clickDiscardHandler}
                   >
                     {message.content}

+ 7 - 7
apps/app/src/features/openai/client/components/AiAssistant/AiAssistantSidebar/MessageCard.tsx

@@ -41,11 +41,11 @@ const NextLinkWrapper = (props: LinkProps & {children: string, href: string}): J
 };
 
 const AssistantMessageCard = ({
-  children, showActionButtons, onAdopt, onDiscard,
+  children, showActionButtons, onAccept, onDiscard,
 }: {
   children: string,
   showActionButtons?: boolean
-  onAdopt?: () => void,
+  onAccept?: () => void,
   onDiscard?: () => void,
 }): JSX.Element => {
   const { t } = useTranslation();
@@ -74,9 +74,9 @@ const AssistantMessageCard = ({
                     <button
                       type="button"
                       className="btn btn-outline-secondary"
-                      onClick={onAdopt}
+                      onClick={onAccept}
                     >
-                      {t('sidebar_ai_assistant.adopt')}
+                      {t('sidebar_ai_assistant.accept')}
                     </button>
                   </div>
                 )}
@@ -99,12 +99,12 @@ type Props = {
   children: string,
   showActionButtons?: boolean,
   onDiscard?: () => void,
-  onAdopt?: () => void,
+  onAccept?: () => void,
 }
 
 export const MessageCard = (props: Props): JSX.Element => {
   const {
-    role, children, showActionButtons, onAdopt, onDiscard,
+    role, children, showActionButtons, onAccept, onDiscard,
   } = props;
 
   return role === 'user'
@@ -112,7 +112,7 @@ export const MessageCard = (props: Props): JSX.Element => {
     : (
       <AssistantMessageCard
         showActionButtons={showActionButtons}
-        onAdopt={onAdopt}
+        onAccept={onAccept}
         onDiscard={onDiscard}
       >{children}
       </AssistantMessageCard>