diff --git a/src/components/Appaside.vue b/src/components/Appaside.vue index ebd5cae..0976ed9 100644 --- a/src/components/Appaside.vue +++ b/src/components/Appaside.vue @@ -45,7 +45,8 @@
-
发布新PK
+ +
{{ t('ReleaseANewPK') }}
@@ -55,12 +56,13 @@ class="input-name-input" v-model="anchorName" size="large" - placeholder="请输入主播名称" + :placeholder="t('PleaseEnterTheNameOfTheHost')" @blur="handleChange()" /> +
- 选择我的主播 + {{ t('ChooseMyStreamer') }}
@@ -70,11 +72,12 @@ v-model="countryvalue" filterable :options="country" - placeholder="请选择国家" + :placeholder="t('PleaseSelectACountry')" size="large" style="vertical-align: middle" class="select" /> +
@@ -83,29 +86,33 @@ filterable :options="genderOptions" size="large" - placeholder="请选择性别" + :placeholder="t('PleaseSelectGender')" style="vertical-align: middle" class="select" /> +
+
-
金币数(单位为K)
+
{{ t('NumberOfGoldCoins') }}
+
-
场次
+
{{ t('Session') }}
+
@@ -116,17 +123,20 @@ class="textarea" style="width: 100%; height: 100%" maxlength="50" - placeholder="请输入备注(选填)" + :placeholder="t('PleaseEnterTheRemarks')" /> + -
确认
-
重置
+
{{ t('Confirm') }}
+ +
{{ t('Reset') }}
+ - +
- {{ item.gender == 1 ? "男" : "女" }} + {{ item.gender == 1 ? t('man') : t('woman') }} +
{{ item.country }}
@@ -161,12 +172,14 @@
-
取消
-
确认
+
{{ t('Cancel') }}
+ +
{{ t('Confirm') }}
+
- +
@@ -179,55 +192,64 @@ > -
点击上方头像修改头像
+
{{ t('ClickOnTheAvatarAboveToModifyIt') }}
+
-
点击输入修改昵称
+
{{ t('ClickToEnterAndModifyYourNickname') }}
+
- + + -
修改密码
+
{{ t('ChangePassword') }}
+
- + +
+ + -
确定
+
{{ t('Confirm') }}
+
@@ -303,6 +325,11 @@ import { import { goeasy } from "../main"; import GoEasy from "goeasy"; var im = goeasy.im; +// +import { useI18n } from 'vue-i18n' +const { t } = useI18n() +window['$t'] = t +// const info = ref({}); // 用户信息 const avatar = ref(null); //头像 const country = ref([]); @@ -321,19 +348,21 @@ const sessionnum = ref(null); // 场次 const remark = ref(null); // 备注 const Avatarlist = [ { - name:'签到', + // gj签到 + name:t('SignIn'), id:1 }, { - name: '设置', + //gj设置 + name: t('Settings'), id: 2, }, { - name: '联系客服(点击复制邮箱)', + name: t('ContactCustomerService'), id: 3, }, { - name: '退出登录', + name: t('Logout'), id: 4, } ] @@ -346,21 +375,24 @@ const NavigationModule = [ Selectedicon:'https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/SelectPKpage.png' }, { - name: '站内信', + //gj论坛 + name: t('InSiteMessage'), id: 2, path: '/nav/Forum', icon: 'https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Forum.png', Selectedicon:'https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Selectinsitemessagepage.png' }, { - name: '消息', + //gj消息 + name: t('message'), id: 3, path: '/nav/Message', icon: 'https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Message.png', Selectedicon:'https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Selectmessagepage.png' }, { - name: '我的', + //gj我的 + name: t('Mine'), id: 4, path: '/nav/Mine', icon: 'https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Mine.png', @@ -918,6 +950,7 @@ onUnmounted(() => { font-size: 12px; color:@Prompt-text-color; margin-top: 5px; + text-align: center; } .redDot{ diff --git a/src/components/LanguageSwitcher.vue b/src/components/LanguageSwitcher.vue index 7946f72..73392a5 100644 --- a/src/components/LanguageSwitcher.vue +++ b/src/components/LanguageSwitcher.vue @@ -20,6 +20,7 @@ import { ref } from 'vue' import { useI18n } from 'vue-i18n' import { setLocale } from '@/i18n' + const { locale } = useI18n() const currentLanguage = ref(locale.value) diff --git a/src/components/mineSubComponent/PKmessage.vue b/src/components/mineSubComponent/PKmessage.vue index c054864..021a9e0 100644 --- a/src/components/mineSubComponent/PKmessage.vue +++ b/src/components/mineSubComponent/PKmessage.vue @@ -97,7 +97,8 @@
-
发布新PK
+ +
{{ t('ReleaseANewPK') }}
修改PK信息
@@ -108,12 +109,13 @@ class="input-name-input" v-model="anchorName" size="large" - placeholder="请输入主播名称" + :placeholder="t('PleaseEnterTheNameOfTheHost')" @blur="handleChange()" /> +
- 选择我的主播 + {{ t('ChooseMyStreamer') }}
@@ -123,11 +125,12 @@ v-model="countryvalue" filterable :options="country" - placeholder="请选择国家" + :placeholder="t('PleaseSelectACountry')" size="large" style="vertical-align: middle" class="select" /> +
@@ -136,29 +139,33 @@ filterable :options="genderOptions" size="large" - placeholder="请选择性别" + :placeholder="t('PleaseSelectGender')" style="vertical-align: middle" class="select" /> +
+
-
金币数(单位为K)
+
{{ t('NumberOfGoldCoins') }}
+
-
场次
+
{{ t('Session') }}
+
@@ -169,11 +176,14 @@ class="textarea" style="width: 100%; height: 100%" maxlength="50" - placeholder="请输入备注(选填)" + :placeholder="t('PleaseEnterTheRemarks')" /> + -
确认
-
重置
+
{{ t('Confirm') }}
+ +
{{ t('Reset') }}
+
取消
@@ -300,7 +310,11 @@ import { getCountryNamesArray } from "../../utils/countryUtil"; import { ElLoading } from "element-plus"; import { ElMessage } from "element-plus"; import { setStorage, getStorage, getPromiseStorage } from "@/utils/storage.js"; - +// +import { useI18n } from 'vue-i18n' +const { t } = useI18n() +window['$t'] = t +// const country = ref([]); country.value = getCountryNamesArray(); //国家条目 const genderOptions = [ diff --git a/src/i18n/en/Appaside.json b/src/i18n/en/Appaside.json new file mode 100644 index 0000000..80b3731 --- /dev/null +++ b/src/i18n/en/Appaside.json @@ -0,0 +1,33 @@ +{ + "InSiteMessage": "In-site message", + "Mine": "Mine", + "SignIn": "Sign in", + "message": "message", + "Settings": "Settings", + "ContactCustomerService": "Contact customer service (click to copy the email address)", + "Logout": "Log out", + "ReleaseANewPK": "Release a new PK", + "PleaseEnterTheNameOfTheHost": "Please enter the name of the host", + "ChooseMyStreamer": "Choose mine", + "PleaseSelectACountry": "Please select a country", + "PleaseSelectGender": "Please select gender", + "SelectThePKTime": "Select the PK time", + "NumberOfGoldCoins": "The number of gold coins (in K)", + "Session": "Session", + "PleaseEnterTheRemarks": "Please enter the remarks (optional)", + "Confirm": "Confirm", + "Reset": "Reset", + "Cancel": "Cancel", + "SelectTheStreamersFromMyStreamerLibrary": "Select the streamers from my streamer library", + "man": "man", + "woman": "woman", + "ClickOnTheAvatarAboveToModifyIt": "Click on the avatar above to modify it", + "ClickToEnterAndModifyYourNickname": "Click to enter and modify your nickname", + "ResendTheEmailTo": "Resend the email to", + "ForVerification": "for verification", + "ModifyTheEmailAddress": "Modify the email address", + "ChangePassword":"Change password", + "PleaseEnterTheOldPassword": "Please enter the old password", + "PleaseEnterTheNewPassword": "Please enter the new password", + "PleaseEnterTheConfirmPassword": "Please enter the confirm password" +} \ No newline at end of file diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 6612cfc..213e045 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -1,9 +1,11 @@ import login from './login.json' +import Appaside from './Appaside.json' const global = { logout: 'Logout', } export default { ...global, - ...login + ...login, + ...Appaside } diff --git a/src/i18n/en/login.json b/src/i18n/en/login.json index d709b0b..05b8e73 100644 --- a/src/i18n/en/login.json +++ b/src/i18n/en/login.json @@ -2,5 +2,11 @@ "login": "Login", "Welcome_to_login": "Welcome to login", "PleaseEnterEmailOrUsername": "Please enter email or username", - "PleaseEnterPassword": "Please enter password" + "PleaseEnterPassword": "Please enter password", + "WechatMiniProgramLogin": "Wechat Mini Program Login", + "LogInByScanningTheQRCodeWithTheWechatMini-program":"Log in by scanning the QR code with the wechat mini-program", + "DontHaveAnAccountYet":"Don't have an account yet?", + "Register":"Register", + "AlreadyHaveAnAccount":"Already have an account?", + "ForgotPassword":"Forgot password?" } \ No newline at end of file diff --git a/src/i18n/index.js b/src/i18n/index.js index 274dc97..97d2523 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -3,11 +3,12 @@ import { createI18n } from 'vue-i18n' //引入vue-i18n组件 import zh from './zh/index' import en from './en/index' +import { setStorage , getStorage } from '@/utils/storage.js'; const i18n = createI18n({ legacy: false, globalInjection:true, - locale: "ZH", // Default language + locale: getStorage('language') || "ZH", // Default language fallbackLocale: "EN", // Fallback to English if translation missing messages: { ZH: zh, @@ -19,7 +20,8 @@ const i18n = createI18n({ export function setLocale(lang) { if (['ZH', 'EN'].includes(lang)) { i18n.global.locale.value = lang + setStorage('language', lang) } } -export default i18n \ No newline at end of file +export default i18n diff --git a/src/i18n/zh/Appaside.json b/src/i18n/zh/Appaside.json new file mode 100644 index 0000000..78eaeb0 --- /dev/null +++ b/src/i18n/zh/Appaside.json @@ -0,0 +1,33 @@ +{ + "InSiteMessage":"站内信", + "Mine":"我的", + "SignIn":"签到", + "message":"消息", + "Settings":"设置", + "ContactCustomerService":"联系客服(点击复制邮箱)", + "Logout":"退出登录", + "ReleaseANewPK":"发布新PK", + "PleaseEnterTheNameOfTheHost":"请输入主播名称", + "ChooseMyStreamer":"选择我的主播", + "PleaseSelectACountry":"请选择国家", + "PleaseSelectGender":"请选择性别", + "SelectThePKTime":"选择PK时间", + "NumberOfGoldCoins":"金币数(单位为K)", + "Session":"场次", + "PleaseEnterTheRemarks":"请输入备注(选填)", + "Confirm":"确认", + "Reset":"重置", + "Cancel":"取消", + "SelectTheStreamersFromMyStreamerLibrary":"选择我的主播库主播", + "man":"男", + "woman":"女", + "ClickOnTheAvatarAboveToModifyIt":"点击头像上方修改头像", + "ClickToEnterAndModifyYourNickname":"点击输入修改昵称", + "ResendTheEmailTo":"向", + "ForVerification":"重发邮箱验证", + "ModifyTheEmailAddress":"修改邮箱", + "ChangePassword":"修改密码", + "PleaseEnterTheOldPassword":"请输入旧密码", + "PleaseEnterTheNewPassword":"请输入新密码", + "PleaseEnterTheConfirmPassword":"请再次输入新密码" +} \ No newline at end of file diff --git a/src/i18n/zh/index.js b/src/i18n/zh/index.js index 9acc261..0f12279 100644 --- a/src/i18n/zh/index.js +++ b/src/i18n/zh/index.js @@ -1,9 +1,11 @@ import login from './login.json' +import Appaside from './Appaside.json' const global = { logout: '退出登录', } export default { ...global, - ...login + ...login, + ...Appaside } \ No newline at end of file diff --git a/src/i18n/zh/login.json b/src/i18n/zh/login.json index 7bfc3ae..3f79230 100644 --- a/src/i18n/zh/login.json +++ b/src/i18n/zh/login.json @@ -2,5 +2,11 @@ "login": "登录", "Welcome_to_login": "欢迎登录", "PleaseEnterEmailOrUsername": "请输入邮箱或用户名", - "PleaseEnterPassword": "请输入密码" + "PleaseEnterPassword": "请输入密码", + "WechatMiniProgramLogin": "微信小程序登录", + "LogInByScanningTheQRCodeWithTheWechatMini-program": "使用微信小程序扫描二维码登录", + "DontHaveAnAccountYet":"还没有账号?", + "Register": "注册", + "AlreadyHaveAnAccount": "已有账号?", + "ForgotPassword": "忘记密码?" } \ No newline at end of file diff --git a/src/utils/storage.js b/src/utils/storage.js index 5b6e9b5..3df5cc2 100644 --- a/src/utils/storage.js +++ b/src/utils/storage.js @@ -20,7 +20,7 @@ export function getPromiseStorage(key) { try { resolve(JSON.parse(data)); } catch { - reject(data); + resolve(data); } }); } diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 7993e44..5a9b8ee 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -16,6 +16,7 @@
+
{{ t('Welcome_to_login') }}
@@ -29,6 +30,7 @@ :placeholder="t('PleaseEnterEmailOrUsername')" @keydown.enter.native="EmailLogin" /> +
@@ -42,25 +44,33 @@ :placeholder="t('PleaseEnterPassword')" @keydown.enter.native="EmailLogin" /> +
+
-
微信小程序登录
+ +
{{ t('WechatMiniProgramLogin') }}
-
使用微信小程序扫描二维码登录
+ +
{{ t('LogInByScanningTheQRCodeWithTheWechatMini-program') }}
-
还没有账号?
-
注册
+ +
{{ t('DontHaveAnAccountYet') }}
+ +
{{ t('Register') }}
-
已有账号?
-
忘记密码?
+ +
{{ t('AlreadyHaveAnAccount') }}
+ +
{{ t('ForgotPassword') }}
@@ -238,10 +248,10 @@ onUnmounted(() => { align-items: center; } .register { - width: 627px; + width: 730px; height: 40px; display: flex; - justify-content:space-between; + justify-content:space-around; } .register-text { font-size: 18px; diff --git a/src/views/nav.vue b/src/views/nav.vue index 689e553..96caab1 100644 --- a/src/views/nav.vue +++ b/src/views/nav.vue @@ -15,14 +15,16 @@