国际化
This commit is contained in:
14
src/App.vue
14
src/App.vue
@@ -18,17 +18,19 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getDefaultLocal } from '@/api/system/user';
|
import { getDefaultLocal } from '@/api/system/user';
|
||||||
const lang = localStorage.getItem('lang')
|
const lang = localStorage.getItem('lang')
|
||||||
if (!lang) {
|
|
||||||
|
const _getDefaultLocal = () => {
|
||||||
getDefaultLocal().then(res => {
|
getDefaultLocal().then(res => {
|
||||||
console.log('res', res)
|
console.log('res', res)
|
||||||
if (res === 'gu_IN') {
|
if (lang !== res) {
|
||||||
localStorage.setItem('lang', 'hi')
|
localStorage.setItem('lang', res)
|
||||||
} else {
|
location.reload()
|
||||||
localStorage.setItem('lang', 'zh')
|
|
||||||
}
|
}
|
||||||
location.reload()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_getDefaultLocal()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
175
src/lang/en_us.ts
Normal file
175
src/lang/en_us.ts
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
// en_us.js文件
|
||||||
|
export default {
|
||||||
|
app: {
|
||||||
|
home: 'Home',
|
||||||
|
serveList: 'Wallet',
|
||||||
|
message: 'Customer Service',
|
||||||
|
my: 'Mine',
|
||||||
|
yuan: 'Yuan',
|
||||||
|
second: 'Second',
|
||||||
|
month: 'Month',
|
||||||
|
prompt: 'Prompt',
|
||||||
|
tips: 'Tips',
|
||||||
|
enterLogout: 'Are you sure you want to log out?',
|
||||||
|
enterWithdrawal: 'Are you sure you want to withdraw?',
|
||||||
|
withdrawal: 'Withdrawal',
|
||||||
|
info: 'Info',
|
||||||
|
success: 'Success',
|
||||||
|
withdrawalAmount: 'Withdrawal Amount',
|
||||||
|
pleaseWithdrawalAmount: 'Please enter the withdrawal amount',
|
||||||
|
submit: 'Submit',
|
||||||
|
submittedSuccessfully: 'Successfully submitted',
|
||||||
|
submitApplication: 'Submit Application',
|
||||||
|
bankCardAbnormality: 'Bank card abnormality',
|
||||||
|
receivedSuccessfully: 'Received successfully',
|
||||||
|
phoneNumber: 'Phone number',
|
||||||
|
verificationCode: 'Verification code',
|
||||||
|
confirm: 'Confirm',
|
||||||
|
enter: 'Please enter',
|
||||||
|
select: 'Please select',
|
||||||
|
send: 'Send',
|
||||||
|
login: 'Login',
|
||||||
|
account: 'Account',
|
||||||
|
logout: 'Logout',
|
||||||
|
register: 'Register',
|
||||||
|
password: 'Password',
|
||||||
|
forgotPassword: 'Forgot password',
|
||||||
|
passwordPlaceholder: 'Please set a password of 6-16 digits',
|
||||||
|
passwordPlaceholder1: 'Please confirm the password again',
|
||||||
|
next: 'Next',
|
||||||
|
update: 'Update',
|
||||||
|
noData: 'No data',
|
||||||
|
none: 'None',
|
||||||
|
contract: 'Contract',
|
||||||
|
loan: 'Loan',
|
||||||
|
totalLoan: 'Total loan',
|
||||||
|
complete: 'Complete',
|
||||||
|
noComplete: 'Incomplete',
|
||||||
|
signature: 'Signature',
|
||||||
|
identityInformation: 'Identity information',
|
||||||
|
information: 'Information',
|
||||||
|
signatureInformation: 'Signature information',
|
||||||
|
receivingBank: 'Receiving bank card',
|
||||||
|
rwmljndzlxx: 'Let us know your information',
|
||||||
|
upPNGOrJPG: 'Please upload a JPG or PNG format image',
|
||||||
|
},
|
||||||
|
home: {
|
||||||
|
productDetails: 'Product Details',
|
||||||
|
minimumDailyInterestRate: 'Minimum Daily Interest Rate',
|
||||||
|
borrowingLimit: 'Borrowing Limit',
|
||||||
|
installmentPeriod: 'Installment Period',
|
||||||
|
optional: 'Optional',
|
||||||
|
applicationAmount: 'Application Amount',
|
||||||
|
loanTerm: 'Loan Term',
|
||||||
|
repaymentPerInstallment: 'Repayment Per Installment',
|
||||||
|
dailyInterestRate: 'Daily Interest Rate',
|
||||||
|
totalInterest: 'Total Interest',
|
||||||
|
successfulBorrowing: 'Successful Borrowing',
|
||||||
|
enterAgreement: 'I have read and agreed to',
|
||||||
|
authAgreement: 'Authorization Agreement',
|
||||||
|
serviceAgreement: 'Platform Service Agreement',
|
||||||
|
lawAgreement: 'Legal Agreement',
|
||||||
|
loansAgreement: 'Loan Agreement',
|
||||||
|
immediateBorrowing: 'Borrow Now',
|
||||||
|
pleaseFillInYourPersonalInformationFirst: 'Please fill in your personal information first',
|
||||||
|
pleaseEnterAgreement: 'Please read and agree to the relevant agreements',
|
||||||
|
},
|
||||||
|
my: {
|
||||||
|
userInfo: 'My Profile',
|
||||||
|
loan: 'My Loans',
|
||||||
|
repayment: 'My Repayments',
|
||||||
|
legalLiability: 'Legal Liability',
|
||||||
|
uploadPassword: 'Change Password',
|
||||||
|
logout: 'Logout',
|
||||||
|
language: 'Switch Language',
|
||||||
|
},
|
||||||
|
serveList: {
|
||||||
|
loan: 'My Loans',
|
||||||
|
balance: 'Account Balance',
|
||||||
|
amountToBeRepaid: 'Amount to Be Repaid',
|
||||||
|
immediateWithdrawal: 'Borrow Now',
|
||||||
|
financialSecurity: 'Account funds security is guaranteed by the bank',
|
||||||
|
},
|
||||||
|
borrowInfo: {
|
||||||
|
applicationTime: 'Application Time',
|
||||||
|
loanDetails: 'Loan Details',
|
||||||
|
loanInfo: 'Borrowing Information',
|
||||||
|
loanNo: 'Loan Number',
|
||||||
|
loanAmount: 'Loan Amount',
|
||||||
|
loanCycle: 'Loan Cycle',
|
||||||
|
withdrawalBank: 'Withdrawal Bank',
|
||||||
|
repaymentPerInstallment: 'Repayment Per Installment',
|
||||||
|
describe: 'Description',
|
||||||
|
receivingAccount: 'Receiving Account',
|
||||||
|
usageOfLoan: 'Purpose of Loan',
|
||||||
|
},
|
||||||
|
loans: {
|
||||||
|
enterSubmitApplication: 'Are you sure you want to apply for a loan?'
|
||||||
|
},
|
||||||
|
userInfo: {
|
||||||
|
realPrompt: 'Please fill in true and valid information to pass the review.',
|
||||||
|
idCardPrompt: 'Please use your own ID card, and make sure the content is clear and readable.',
|
||||||
|
photographPrompt: 'Please confirm that the camera permission is enabled.',
|
||||||
|
name: 'Name',
|
||||||
|
idCard: 'ID Card Number',
|
||||||
|
idCardUp1: 'Click to upload the front side of your ID card',
|
||||||
|
idCardUp2: 'Click to upload the back side of your ID card (with the national emblem)',
|
||||||
|
idCardUp3: 'Click to upload a photo holding your ID card',
|
||||||
|
shootingRequirements: 'Photography Requirements',
|
||||||
|
standardShooting: 'Standard Shooting',
|
||||||
|
missingBorder: 'Missing Borders',
|
||||||
|
outOfFocus: 'Blurry Photo',
|
||||||
|
flashStrongly: 'Strong Flash',
|
||||||
|
unitName: 'Company Name',
|
||||||
|
position: 'Position',
|
||||||
|
workTelephone: 'Work Phone',
|
||||||
|
workingAge: 'Years of Work Experience',
|
||||||
|
monthlyPay: 'Monthly Salary',
|
||||||
|
unitAddress: 'Company Address',
|
||||||
|
addressInfo: 'Detailed Address',
|
||||||
|
currentResidentialAddress: 'Current Residential Address',
|
||||||
|
directFamilyContactPerson: 'Immediate Family Contact',
|
||||||
|
relationship: 'Relationship',
|
||||||
|
parents: 'Parents',
|
||||||
|
spouse: 'Spouse',
|
||||||
|
children: 'Children',
|
||||||
|
grandparents: 'Grandparents',
|
||||||
|
bankOfDeposit: 'Bank of Deposit',
|
||||||
|
bankCard: 'Bank Card Number',
|
||||||
|
},
|
||||||
|
router: {
|
||||||
|
home: 'Home',
|
||||||
|
serveList: 'Wallet',
|
||||||
|
message: 'Chat',
|
||||||
|
my: 'Mine',
|
||||||
|
userInfo: 'My Profile',
|
||||||
|
userInfo1: 'Basic Information',
|
||||||
|
signature: 'Signature',
|
||||||
|
contract: 'Contract',
|
||||||
|
userInfo2: 'Submit Documents',
|
||||||
|
userInfo3: 'Receiving Bank Card',
|
||||||
|
loansInfo: 'Loan Details',
|
||||||
|
loansInfo1: 'Withdrawal',
|
||||||
|
myLoan: 'My Loans',
|
||||||
|
myRepayment: 'My Repayments',
|
||||||
|
borrowInfo: 'Borrowing Details',
|
||||||
|
uploadPassword: 'Change Password',
|
||||||
|
login: 'Login',
|
||||||
|
register: 'Register',
|
||||||
|
forget: 'Forgot Password',
|
||||||
|
agreement: 'Agreement',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -137,11 +137,6 @@ export default {
|
|||||||
bankOfDeposit: 'खाता खोलने वाला बैंक',
|
bankOfDeposit: 'खाता खोलने वाला बैंक',
|
||||||
bankCard: 'बैंक कार्ड नंबर',
|
bankCard: 'बैंक कार्ड नंबर',
|
||||||
},
|
},
|
||||||
language: {
|
|
||||||
zh: '中文',
|
|
||||||
id: 'Bahasa indonesia',
|
|
||||||
hi: 'हिंदी'
|
|
||||||
},
|
|
||||||
router: {
|
router: {
|
||||||
home: 'मुख्य पृष्ठ',
|
home: 'मुख्य पृष्ठ',
|
||||||
serveList: 'वॉलेट',
|
serveList: 'वॉलेट',
|
||||||
|
|||||||
@@ -137,11 +137,6 @@ export default {
|
|||||||
bankOfDeposit: 'Bank tempat rekening',
|
bankOfDeposit: 'Bank tempat rekening',
|
||||||
bankCard: 'Nomor rekening bank',
|
bankCard: 'Nomor rekening bank',
|
||||||
},
|
},
|
||||||
language: {
|
|
||||||
zh: '中文',
|
|
||||||
id: 'Bahasa indonesia',
|
|
||||||
hi: 'हिंदी'
|
|
||||||
},
|
|
||||||
router: {
|
router: {
|
||||||
home: 'Beranda',
|
home: 'Beranda',
|
||||||
serveList: 'Dompet',
|
serveList: 'Dompet',
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ import {Locale} from 'vant'
|
|||||||
import zhCN from 'vant/lib/locale/lang/zh-CN'
|
import zhCN from 'vant/lib/locale/lang/zh-CN'
|
||||||
import idId from 'vant/lib/locale/lang/id-ID'
|
import idId from 'vant/lib/locale/lang/id-ID'
|
||||||
import hiIN from 'vant/lib/locale/lang/hi-IN'
|
import hiIN from 'vant/lib/locale/lang/hi-IN'
|
||||||
|
import enUS from 'vant/lib/locale/lang/en-US'
|
||||||
import zhLocale from './zh_cn'
|
import zhLocale from './zh_cn'
|
||||||
import idLocale from './id_ID'
|
import idLocale from './id_ID'
|
||||||
import hiLocale from './hi-IN'
|
import hiLocale from './hi-IN'
|
||||||
|
import enLocale from './en_us'
|
||||||
import type { App } from 'vue';
|
import type { App } from 'vue';
|
||||||
|
|
||||||
|
|
||||||
@@ -21,6 +23,10 @@ const messages = {
|
|||||||
hi: {
|
hi: {
|
||||||
...hiIN,
|
...hiIN,
|
||||||
...hiLocale
|
...hiLocale
|
||||||
|
},
|
||||||
|
en: {
|
||||||
|
...enUS,
|
||||||
|
...enLocale
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,15 +46,24 @@ const i18n = createI18n({
|
|||||||
// 更新vant组件库本身的语言变化,支持国际化
|
// 更新vant组件库本身的语言变化,支持国际化
|
||||||
function vantLocales (app: App<Element>) {
|
function vantLocales (app: App<Element>) {
|
||||||
app.use(i18n)
|
app.use(i18n)
|
||||||
const lan = defLanguage || language.split('-')[0] || 'zh'
|
const lan = defLanguage || language.split('-')[0] || 'zh-CN'
|
||||||
if (lan === 'hi') {
|
const lanMap = {
|
||||||
Locale.use(lan, hiIN)
|
'hi-IN': hiIN,
|
||||||
console.log('========================', lan)
|
'id-ID': idId,
|
||||||
} else if (lan === 'id') {
|
'zh-CN': zhCN,
|
||||||
Locale.use(lan, idId)
|
'en-US': enUS,
|
||||||
} else {
|
|
||||||
Locale.use(lan, zhCN)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Locale.use(lan, lanMap[lan] || zhCN)
|
||||||
|
|
||||||
|
// if (lan === 'hi') {
|
||||||
|
// Locale.use(lan, hiIN)
|
||||||
|
// console.log('========================', lan)
|
||||||
|
// } else if (lan === 'id') {
|
||||||
|
// Locale.use(lan, idId)
|
||||||
|
// } else {
|
||||||
|
// Locale.use(lan, zhCN)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
export {i18n, vantLocales}
|
export {i18n, vantLocales}
|
||||||
|
|||||||
@@ -137,11 +137,6 @@ export default {
|
|||||||
bankOfDeposit: '开户银行',
|
bankOfDeposit: '开户银行',
|
||||||
bankCard: '银行卡号',
|
bankCard: '银行卡号',
|
||||||
},
|
},
|
||||||
language: {
|
|
||||||
zh: '中文',
|
|
||||||
id: 'Bahasa indonesia',
|
|
||||||
hi: 'हिंदी'
|
|
||||||
},
|
|
||||||
router: {
|
router: {
|
||||||
home: '首页',
|
home: '首页',
|
||||||
serveList: '钱包',
|
serveList: '钱包',
|
||||||
|
|||||||
@@ -67,13 +67,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell :title="$t('my.language')" is-link @click="checkLanguage()" >
|
<!-- <van-cell :title="$t('my.language')" is-link @click="checkLanguage()" >-->
|
||||||
<template #icon>
|
<!-- <template #icon>-->
|
||||||
<div style="display: flex; justify-content: center; align-items: center; padding-right: 5px">
|
<!-- <div style="display: flex; justify-content: center; align-items: center; padding-right: 5px">-->
|
||||||
<van-icon name="chat-o" />
|
<!-- <van-icon name="chat-o" />-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
</van-cell>
|
<!-- </van-cell>-->
|
||||||
<van-cell :title="$t('my.logout')" is-link @click="logout" >
|
<van-cell :title="$t('my.logout')" is-link @click="logout" >
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<div style="display: flex; justify-content: center; align-items: center; padding-right: 5px">
|
<div style="display: flex; justify-content: center; align-items: center; padding-right: 5px">
|
||||||
@@ -154,9 +154,10 @@ const checkLanguage = () => {
|
|||||||
const showPicker = ref(false)
|
const showPicker = ref(false)
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ text: '中文', value: 'zh' },
|
{ text: '中文', value: 'zh-CN' },
|
||||||
{ text: 'Bahasa indonesia', value: 'id' },
|
{ text: 'Bahasa indonesia', value: 'id-ID' },
|
||||||
{ text: 'हिंदी', value: 'hi' },
|
{ text: 'हिंदी', value: 'hi-IN' },
|
||||||
|
{ text: 'English', value: 'en-US' },
|
||||||
// { text: t('language.zh'), value: 'zh' },
|
// { text: t('language.zh'), value: 'zh' },
|
||||||
// { text: t('language.hi'), value: 'hi' },
|
// { text: t('language.hi'), value: 'hi' },
|
||||||
// { text: t('language.id'), value: 'id' },
|
// { text: t('language.id'), value: 'id' },
|
||||||
|
|||||||
Reference in New Issue
Block a user