Handy_Cao 1 年間 前
コミット
00c7eccddd

+ 1 - 0
public/locales/en-US.json

@@ -1150,6 +1150,7 @@
             "language": "Language",
             "chinese": "Chinese",
             "english": "English",
+            "enth": "Thai",
             "orderBuyOrSell": "OrderBuyOrSell",
             "orderQtyIsEmpty": "OrderQtyIsEmpty",
             "priceFocusType": "PriceFocusType",

+ 1 - 0
public/locales/th-TH.json

@@ -1154,6 +1154,7 @@
             "language": "ตั้งค่าภาษา",
             "chinese": "จีนย่อ",
             "english": "ภาษาอังกฤษ",
+            "enth": "ภาษาไทย",
             "orderBuyOrSell": "ทิศทางปริยายของการขาย",
             "orderQtyIsEmpty": "ล้างจำนวนเงินหลังจากสั่งซื้อ",
             "priceFocusType": "ประเภทของการสั่งซื้อ",

+ 1 - 0
public/locales/zh-CN.json

@@ -1154,6 +1154,7 @@
             "language": "语言设置",
             "chinese": "简体中文",
             "english": "英文",
+            "enth": "泰语",
             "orderBuyOrSell": "默认买卖方向",
             "orderQtyIsEmpty": "下单后清空数量",
             "priceFocusType": "下单价格类型",

+ 10 - 8
src/packages/pc/components/layouts/header/components/setting/index.vue

@@ -57,7 +57,11 @@
             <legend class="g-fieldset__legend">{{ t('mine.setting.others') }}</legend>
             <el-form ref="formRef" class="el-form--horizontal" label-width="80px">
                 <el-form-item :label="t('mine.setting.language')">
-                    <span @click="changeLuanguage">{{ i18n.global.locale === 'zh-CN' ? t('mine.setting.chinese') : t('mine.setting.english') }}</span>
+                    <el-select effect="dark" :placeholder="t('common.choice')" v-model="luanguage" @change="changeLuanguage">
+                        <el-option :label="t('mine.setting.chinese')" value="zh-CN" />
+                        <el-option :label="t('mine.setting.english')" value="en-US" />
+                        <el-option :label="t('mine.setting.enth')" value="th-TH" />
+                    </el-select>
                 </el-form-item>
             </el-form>
         </fieldset>
@@ -83,17 +87,15 @@ const show = ref(true)
 const formData = ref({ ...settingStore.userSetting })
 const { t } = i18n.global
 
+const luanguage = i18n.global.locale
+
 const onCancel = () => {
     show.value = false
 }
 
-const changeLuanguage = () => {
-    ElMessageBox.confirm(t('user.login.tips6'), t('common.tips'), { confirmButtonText: t('common.ikonw') }).then(() => {
-        if (i18n.global.locale === 'zh-CN') {
-            i18n.global.locale = 'en-US'
-        } else {
-            i18n.global.locale = 'zh-CN'
-        }
+const changeLuanguage = (e) => {
+    ElMessageBox.confirm(t('user.login.tips6'), t('common.tips'), { confirmButtonText: t('common.ikonw'), cancelButtonText: t('operation.cancel') }).then(() => {
+        i18n.global.locale = e
         /// 设置语言
         localData.setValue('appLanguage', i18n.global.locale)
         /// 重新登出