Преглед изворни кода

fix(i18n): 补充缺失的多语言配置

1. 补充header组件中缺失的多语言配置项
2. 调整header右侧几个菜单的边框颜色,适配主题切换
zhupei@smartai.com пре 1 година
родитељ
комит
78d88ab0a5

+ 7 - 0
public/i18n/lang-en.json

@@ -1,4 +1,11 @@
 {
+  "site": {
+    "name": "SmartAI LM Platform"
+  },
+  "theme": {
+    "light": "Light",
+    "dark": "Dark"
+  },
   "message": {
     "hello": "hello world"
   },

+ 7 - 0
public/i18n/lang-zh.json

@@ -1,4 +1,11 @@
 {
+  "site": {
+    "name": "SmartAI大模型平台"
+  },
+  "theme": {
+    "light": "亮色模式",
+    "dark": "暗色模式"
+  },
   "message": {
     "hello": "欢迎光临"
   },

+ 2 - 2
src/views/common/Header.vue

@@ -3,7 +3,7 @@
     <div class="header-left">
       <img class="header-logo-img" src="../../assets/logo.png" />
 
-      <span>SmartAI大模型平台</span>
+      <span>{{ $t('site.name') }}</span>
     </div>
 
     <div class="header-center">
@@ -135,7 +135,7 @@ const handleNameChange = () => {
   width: 30px;
   height: 30px;
   border-radius: 20px;
-  border: solid 1px #e5e6eb;
+  border: solid 1px var(--color-border-2);
 
   display: flex;
   justify-content: center;

+ 1 - 1
src/views/common/header-btns/BtnLanguage.vue

@@ -29,7 +29,7 @@ const handleSelect = (value) => {
   width: 30px;
   height: 30px;
   border-radius: 20px;
-  border: solid 1px #e5e6eb;
+  border: solid 1px var(--color-border-2);
 
   display: flex;
   justify-content: center;

+ 3 - 3
src/views/common/header-btns/BtnTheme.vue

@@ -5,8 +5,8 @@
     </div>
 
     <template #content>
-      <a-doption value="light">浅色主题</a-doption>
-      <a-doption value="dark">深色主题</a-doption>
+      <a-doption value="light">{{ $t('theme.light') }}</a-doption>
+      <a-doption value="dark">{{ $t('theme.dark') }}</a-doption>
     </template>
   </a-dropdown>
 </template>
@@ -43,7 +43,7 @@ const handleSelect = (value) => {
   width: 30px;
   height: 30px;
   border-radius: 20px;
-  border: solid 1px #e5e6eb;
+  border: solid 1px var(--color-border-2);
 
   display: flex;
   justify-content: center;