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

fix: 完善对话部分的多语言

zhupei@smartai.com 1 год назад
Родитель
Сommit
fbf23b50e5

+ 14 - 1
public/i18n/lang-en.json

@@ -205,6 +205,19 @@
     "input_placholder": "Enter text content",
     "input_confirm": "Confirm",
 
-    "back": "Back"
+    "back": "Back",
+    "source": "Source",
+    "view_links": "View all associations",
+    "view_details": "View details",
+    "doc_details": "Document Details",
+    "related_docs": "Documents",
+    "doc_total": "There are a total of {total}",
+    "fragments": "Retrieve fragments",
+
+    "btn_ok": "Confirm",
+    "btn_cancel": "Cancel",
+    "btn_stop": "Stop",
+
+    "copy": "Copy"
   }
 }

+ 14 - 1
public/i18n/lang-zh.json

@@ -206,6 +206,19 @@
     "input_placholder": "输入文本内容",
     "input_confirm": "发送",
 
-    "back": "返回"
+    "back": "返回",
+    "source": "来源",
+    "view_links": "查看全部关联",
+    "view_details": "查看详情",
+    "doc_details": "文档详情",
+    "related_docs": "以下是根据您的提问搜索到的相关文档",
+    "doc_total": "共{total}条",
+    "fragments": "检索片段",
+
+    "btn_ok": "确定",
+    "btn_cancel": "取消",
+    "btn_stop": "停止生成",
+
+    "copy": "复制"
   }
 }

+ 4 - 4
src/modules/answer-refference/RefferenceDocDetail.vue

@@ -2,7 +2,7 @@
   <main>
     <div class="left">
       <header>
-        <div @click="goBack"><icon-left style="margin-right: 5px" />返回知识问答</div>
+        <div @click="goBack"><icon-left style="margin-right: 5px" />{{ $t('conversation.back') }}</div>
       </header>
       <!-- <div>
         <div style="background-color: rgb(255, 110, 110)">{{ userName?.slice(0, 1) }}</div>
@@ -10,8 +10,8 @@
       </div> -->
 
       <p>
-        <span>以下是根据您的提问搜索到的相关文档</span>
-        <span>共 {{ list.length }} 条</span>
+        <span>{{ $t('conversation.related_docs') }}</span>
+        <span>{{ $t('conversation.doc_total', { total: list.length }) }}</span>
       </p>
       <section>
         <div
@@ -27,7 +27,7 @@
             <p>{{ item.doc_name }}</p>
             <p>{{ item.desc }}</p>
             <span>
-              <b>检索片段</b>
+              <b>{{ $t('conversation.fragments') }}</b>
               <em></em>
             </span>
             <div

+ 8 - 3
src/modules/answer-refference/RefferenceFileBlocks.vue

@@ -1,8 +1,11 @@
 <template>
   <div>
     <header class="client-formated-markdown-element-item client-formated-markdown-refference-header">
-      <div>来源</div>
-      <div class="btn-show-related-all" @click="showAllRelated">查看全部关联 <icon-double-right /></div>
+      <div>{{ $t('conversation.source') }}</div>
+
+      <div class="btn-show-related-all" @click="showAllRelated">
+        {{ $t('conversation.view_links') }} <icon-double-right />
+      </div>
     </header>
 
     <RefferenceFileNameList :document_list="document_list" @showDocDetail="handleShowDocDetail" />
@@ -13,11 +16,13 @@
       :visible="visible"
       :placement="position"
       data-flag="reffernce-file-block-drawer"
+      :ok-text="$t('conversation.btn_ok')"
+      :cancel-text="$t('conversation.btn_cancel')"
       @ok="handleOk"
       @cancel="handleCancel"
       unmountOnClose
     >
-      <template #title> 文档详情 </template>
+      <template #title> {{ $t('conversation.doc_details') }} </template>
 
       <div>
         <RefferenceDocDetail :targetDocument="targetDocument" @back="handleBackQA" />

+ 2 - 2
src/modules/answer-refference/RefferenceFileNameContentLinks.vue

@@ -7,7 +7,7 @@
     </div>
 
     <div class="knowledge-footer">
-      <p>检索片段</p>
+      <p>{{ $t('conversation.fragments') }}</p>
 
       <p>
         <span
@@ -21,7 +21,7 @@
         </span>
       </p>
 
-      <div class="show-detail-btn" @click="goKnowledge(knowledge)">查看详情></div>
+      <div class="show-detail-btn" @click="goKnowledge(knowledge)">{{ $t('conversation.view_details') }}></div>
     </div>
   </div>
 </template>

+ 3 - 2
src/modules/conversation-item/BtnStopChat.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="btn-chat-stop-generate" @click="handleClick">停止生成</div>
+  <div class="btn-chat-stop-generate" @click="handleClick">{{ $t('conversation.btn_stop') }}</div>
 </template>
 
 <script setup>
@@ -16,7 +16,8 @@ const handleClick = () => {
   padding: 5px;
   font-size: 14px;
 
-  background-color: #fff;
+  /* background-color: #fff; */
+  background-color: var(--color-bg-1);
   border-radius: 5px;
   border-width: 1px;
   border-style: solid;

+ 1 - 1
src/modules/conversation-item/DialogActions.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="dialog-actions-container">
     <div class="dialog-action-part dialog-action-left">
-      <a-tooltip content="复制" position="right">
+      <a-tooltip :content="$t('conversation.copy')" position="right">
         <div class="action-btn-item" @click="handleCopy">
           <icon-copy size="18" />
         </div>