提交 41afcf10 编写于 作者: zhujiamin's avatar zhujiamin

多语言 组件i18n国际化支持

上级 48b58e78
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div class="app-404"> <div class="app-404">
<img src="assets/images/404.jpg" alt /> <img src="assets/images/404.jpg" alt />
<div class="btnbox"> <div class="btnbox">
<ion-button class="backbtn" @click="back">上一步</ion-button> <ion-button class="backbtn" @click="back">{{$t('previous')}}</ion-button>
<ion-button class="backbtn" @click="backindex">返回首页</ion-button> <ion-button class="backbtn" @click="backindex">{{$t('homepage')}}</ion-button>
</div> </div>
</div> </div>
</template> </template>
...@@ -18,7 +18,19 @@ import { ...@@ -18,7 +18,19 @@ import {
} from "vue-property-decorator"; } from "vue-property-decorator";
@Component({ @Component({
components: {} components: {},
i18n: {
messages: {
'ZH-CN': {
previous: '上一步',
homepage: '返回首页',
},
'EN-US': {
previous: 'Previous',
homepage: 'Back to homepage',
}
}
}
}) })
export default class App404 extends Vue { export default class App404 extends Vue {
/** /**
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div class="app-500"> <div class="app-500">
<img src="assets/images/500.jpg" alt /> <img src="assets/images/500.jpg" alt />
<div class="btnbox"> <div class="btnbox">
<ion-button class="backbtn" @click="back">上一步</ion-button> <ion-button class="backbtn" @click="back">{{$t('previous')}}</ion-button>
<ion-button class="backbtn" @click="backindex">返回首页</ion-button> <ion-button class="backbtn" @click="backindex">{{$t('homepage')}}</ion-button>
</div> </div>
</div> </div>
</template> </template>
...@@ -18,7 +18,19 @@ import { ...@@ -18,7 +18,19 @@ import {
} from "vue-property-decorator"; } from "vue-property-decorator";
@Component({ @Component({
components: {} components: {},
i18n: {
messages: {
'ZH-CN': {
previous: '上一步',
homepage: '返回首页',
},
'EN-US': {
previous: 'Previous',
homepage: 'Homepage',
}
}
}
}) })
export default class App404 extends Vue { export default class App404 extends Vue {
/** /**
......
...@@ -16,16 +16,16 @@ ...@@ -16,16 +16,16 @@
<div class="infoline"> <div class="infoline">
<div class="booktypebox"> <div class="booktypebox">
<div > <div >
<p class="type-p">副标题</p> <p class="type-p">{{$t('subtitle')}}</p>
</div> </div>
<p class="typeinfo" v-if="item.subtitle">{{item.subtitle}}</p> <p class="typeinfo" v-if="item.subtitle">{{item.subtitle}}</p>
</div> </div>
<div> <div>
<p class="type-p">数量</p> <p class="type-p">{{$t('number')}}</p>
<p class="typeinfo" v-if="item.num">{{item.num}}</p> <p class="typeinfo" v-if="item.num">{{item.num}}</p>
</div> </div>
<div> <div>
<p class="type-p">内容</p> <p class="type-p">{{$t('content')}}</p>
<p class="typeinfo" v-if="item.content">{{item.content}}</p> <p class="typeinfo" v-if="item.content">{{item.content}}</p>
</div> </div>
</div> </div>
...@@ -45,7 +45,21 @@ import { ...@@ -45,7 +45,21 @@ import {
} from "vue-property-decorator"; } from "vue-property-decorator";
@Component({ @Component({
components: {} components: {},
i18n: {
messages: {
'ZH-CN': {
subtitle: '副标题',
number: '数量',
content: '内容',
},
'EN-US': {
subtitle: 'Subtitle',
number: 'Number',
content: 'Content',
}
}
}
}) })
export default class AppCardList extends Vue{ export default class AppCardList extends Vue{
......
...@@ -40,13 +40,15 @@ Vue.use(Uploader); ...@@ -40,13 +40,15 @@ Vue.use(Uploader);
i18n: { i18n: {
messages: { messages: {
'ZH-CN': { 'ZH-CN': {
uploadtext: '上传文件' one_doc: '该功能只支持单个文件上传',
upload_failed: '上传失败!',
}, },
'EN-US': { 'EN-US': {
uploadtext: 'upload files' one_doc: 'This function only supports single file upload',
upload_failed: 'Upload failed!',
} }
} }
}, }
components: {} components: {}
}) })
export default class AppMobFileUpload extends Vue { export default class AppMobFileUpload extends Vue {
...@@ -123,7 +125,7 @@ export default class AppMobFileUpload extends Vue { ...@@ -123,7 +125,7 @@ export default class AppMobFileUpload extends Vue {
public beforeRead(file: any, detail: any): boolean { public beforeRead(file: any, detail: any): boolean {
this.dataProcess(); this.dataProcess();
if (file && Array.isArray(file)) { if (file && Array.isArray(file)) {
this.$notice.warning('该功能只支持单个文件上传'); this.$notice.warning(`${this.$t('one_doc')}`);
return false; return false;
} }
return true; return true;
...@@ -468,7 +470,7 @@ export default class AppMobFileUpload extends Vue { ...@@ -468,7 +470,7 @@ export default class AppMobFileUpload extends Vue {
* @memberof AppMobFileUpload * @memberof AppMobFileUpload
*/ */
public onError(error: any, file: any, fileList: any) { public onError(error: any, file: any, fileList: any) {
this.$notice.error('上传失败'); this.$notice.error(`${this.$t('upload_failed')}`);
} }
/** /**
......
...@@ -37,7 +37,18 @@ import { Uploader } from 'vant'; ...@@ -37,7 +37,18 @@ import { Uploader } from 'vant';
import { Loading, Util } from '@/ibiz-core/utils'; import { Loading, Util } from '@/ibiz-core/utils';
Vue.use(Uploader); Vue.use(Uploader);
@Component({ @Component({
components: { components: {},
i18n: {
messages: {
'ZH-CN': {
one_doc: '该功能只支持单个文件上传',
upload_failed: '上传失败!',
},
'EN-US': {
one_doc: 'This function only supports single file upload',
upload_failed: 'Upload failed!',
}
}
} }
}) })
export default class AppMobPicture extends Vue { export default class AppMobPicture extends Vue {
...@@ -119,7 +130,7 @@ export default class AppMobPicture extends Vue { ...@@ -119,7 +130,7 @@ export default class AppMobPicture extends Vue {
public beforeRead(file: any, detail: any): boolean { public beforeRead(file: any, detail: any): boolean {
this.dataProcess(); this.dataProcess();
if (file && Array.isArray(file)) { if (file && Array.isArray(file)) {
this.$notify({ type: 'warning', message: '该功能只支持单个文件上传' }); this.$notify({ type: 'warning', message: this.$t('one_doc') + '' });
return false; return false;
} }
return true; return true;
...@@ -464,7 +475,7 @@ export default class AppMobPicture extends Vue { ...@@ -464,7 +475,7 @@ export default class AppMobPicture extends Vue {
* @memberof AppMobPicture * @memberof AppMobPicture
*/ */
public onError(error: any, file: any, fileList: any) { public onError(error: any, file: any, fileList: any) {
this.$notify({ type: 'danger', message: '上传失败' }); this.$notify({ type: 'danger', message: this.$t('upload_failed') + '' });
} }
/** /**
......
...@@ -56,14 +56,16 @@ const Recorder = require('recorder-core/recorder.mp3.min'); ...@@ -56,14 +56,16 @@ const Recorder = require('recorder-core/recorder.mp3.min');
i18n: { i18n: {
messages: { messages: {
'ZH-CN': { 'ZH-CN': {
openrecorder: '打开录音', notopenrecorder: '未打开录音',
startrecorder: '开始录音', recorderhasopened: '录音功能已打开',
endrecorder: '结束录音', recorderopenfailed: '录音功能打开失败',
uploadfailed: '上传失败!',
}, },
'EN-US': { 'EN-US': {
openrecorder: 'open recorder', notopenrecorder: 'Recorder is not turned on',
startrecorder: 'start recorder', recorderhasopened: 'Recorder is turned on',
endrecorder: 'end recorder', recorderopenfailed: 'Recorder failed to open',
uploadfailed: 'Upload failed!',
} }
} }
} }
...@@ -177,7 +179,7 @@ export default class AppMobRecorder extends Vue { ...@@ -177,7 +179,7 @@ export default class AppMobRecorder extends Vue {
this.rec = null; this.rec = null;
if (!rec) { if (!rec) {
// This.reclog("未打开录音", 1); // This.reclog("未打开录音", 1);
this.$notice.error('未打开录音'); this.$notice.error(`${this.$t('notopenrecorder')}`);
return; return;
} }
...@@ -200,7 +202,7 @@ export default class AppMobRecorder extends Vue { ...@@ -200,7 +202,7 @@ export default class AppMobRecorder extends Vue {
public recStart() { public recStart() {
if (!this.rec) { if (!this.rec) {
// this.reclog("未打开录音", 1); // this.reclog("未打开录音", 1);
this.$notice.error('未打开录音'); this.$notice.error(`${this.$t('notopenrecorder')}`);
return; return;
} }
this.rec.start(); this.rec.start();
...@@ -234,13 +236,13 @@ export default class AppMobRecorder extends Vue { ...@@ -234,13 +236,13 @@ export default class AppMobRecorder extends Vue {
rec.open(() => { rec.open(() => {
// This.dialogCancel(); // This.dialogCancel();
// This.reclog("已打开:" + This.type + " " + This.sampleRate + "hz " + This.bitRate + "kbps", 2); // This.reclog("已打开:" + This.type + " " + This.sampleRate + "hz " + This.bitRate + "kbps", 2);
this.$notice.success('录音功能已打开'); this.$notice.success(`${this.$t('recorderhasopened')}`);
// this.wave = Recorder.WaveView({ elem: this.$refs.recorder }); // this.wave = Recorder.WaveView({ elem: this.$refs.recorder });
}, (msg: any, isUserNotAllow: any) => { }, (msg: any, isUserNotAllow: any) => {
// This.dialogCancel(); // This.dialogCancel();
// This.reclog((isUserNotAllow ? "UserNotAllow," : "") + "打开失败:" + msg, 1); // This.reclog((isUserNotAllow ? "UserNotAllow," : "") + "打开失败:" + msg, 1);
this.$notice.success('录音功能打开失败'); this.$notice.success(`${this.$t('recorderopenfailed')}`);
}); });
// This.waitDialogClickFn = () => { // This.waitDialogClickFn = () => {
// This.dialogCancel(); // This.dialogCancel();
...@@ -639,7 +641,7 @@ export default class AppMobRecorder extends Vue { ...@@ -639,7 +641,7 @@ export default class AppMobRecorder extends Vue {
* @memberof AppMobRecorder * @memberof AppMobRecorder
*/ */
public onError(error: any, file: any, fileList: any) { public onError(error: any, file: any, fileList: any) {
this.$notify({ type: 'danger', message: '上传失败' }); this.$notify({ type: 'danger', message: this.$t('uploadfailed') + '' });
} }
/** /**
......
...@@ -13,7 +13,23 @@ import { Vue, Component, Prop, Watch, Model } from "vue-property-decorator"; ...@@ -13,7 +13,23 @@ import { Vue, Component, Prop, Watch, Model } from "vue-property-decorator";
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { ViewOpenService } from '../../utils/view-open-service/view-open-service'; import { ViewOpenService } from '../../utils/view-open-service/view-open-service';
@Component({ @Component({
components: {} components: {},
i18n: {
messages: {
'ZH-CN': {
associated_entity: '请在对应实体属性中配置关联实体与数据集!',
error_request: '错误,请求异常!',
error_system: '错误,系统异常!',
error_value: '错误,值项异常!',
},
'EN-US': {
associated_entity: 'Please configure the associated entity and data set in the corresponding entity properties!',
error_request: 'Error, request exception!',
error_system: 'Error, the system is abnormal!',
error_value: 'Error, abnormal value item!',
}
}
}
}) })
export default class AppSelectDropDown extends Vue { export default class AppSelectDropDown extends Vue {
/** /**
...@@ -312,7 +328,7 @@ export default class AppSelectDropDown extends Vue { ...@@ -312,7 +328,7 @@ export default class AppSelectDropDown extends Vue {
this.inputState = false; this.inputState = false;
Object.assign(_param, { query: query }); Object.assign(_param, { query: query });
if (!this.acParams.serviceName || !this.acParams.interfaceName) { if (!this.acParams.serviceName || !this.acParams.interfaceName) {
this.$notice.error('请在对应实体属性中配置关联实体与数据集!'); this.$notice.error(`${this.$t('associated_entity')}` );
return; return;
} }
const appEntityServiceConstructor = window.appEntityServiceConstructor; const appEntityServiceConstructor = window.appEntityServiceConstructor;
...@@ -324,7 +340,7 @@ export default class AppSelectDropDown extends Vue { ...@@ -324,7 +340,7 @@ export default class AppSelectDropDown extends Vue {
this.items = response.data; this.items = response.data;
this.result(this.items); this.result(this.items);
} else { } else {
this.$notice.error('错误,请求异常!'); this.$notice.error(`${this.$t('error_request')}` );
} }
} }
} }
...@@ -513,7 +529,7 @@ export default class AppSelectDropDown extends Vue { ...@@ -513,7 +529,7 @@ export default class AppSelectDropDown extends Vue {
private openRedirectView($event: any, view: any, data: any): void { private openRedirectView($event: any, view: any, data: any): void {
this.$http.get(view.url, data).then((response: any) => { this.$http.get(view.url, data).then((response: any) => {
if (!response || response.status !== 200) { if (!response || response.status !== 200) {
this.$notice.error('错误,请求异常!'); this.$notice.error(`${this.$t('error_request')}`);
} }
if (response.status === 401) { if (response.status === 401) {
return; return;
...@@ -565,7 +581,7 @@ export default class AppSelectDropDown extends Vue { ...@@ -565,7 +581,7 @@ export default class AppSelectDropDown extends Vue {
} }
}).catch((response: any) => { }).catch((response: any) => {
if (!response || !response.status || !response.data) { if (!response || !response.status || !response.data) {
this.$notice.error('错误,系统异常!'); this.$notice.error(`${this.$t('error_system')}`);
return; return;
} }
if (response.status === 401) { if (response.status === 401) {
...@@ -584,7 +600,7 @@ export default class AppSelectDropDown extends Vue { ...@@ -584,7 +600,7 @@ export default class AppSelectDropDown extends Vue {
return; return;
} }
if (!this.data || !this.valueitem || !this.data[this.valueitem]) { if (!this.data || !this.valueitem || !this.data[this.valueitem]) {
this.$notice.error('错误,值项异常'); this.$notice.error(`${this.$t('error_value')}`);
return; return;
} }
// 公共参数处理 // 公共参数处理
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<van-cell v-if="i.group == item" :title="i.srfmajortext" @click="test" /> <van-cell v-if="i.group == item" :title="i.srfmajortext" @click="test" />
</div> </div>
</div> </div>
<div v-if="marklist.length==0">没有group属性无法分组</div> <div v-if="marklist.length==0">{{$t('without_group')}}</div>
</van-index-bar> </van-index-bar>
</template> </template>
<script lang="ts"> <script lang="ts">
...@@ -20,7 +20,17 @@ import { ...@@ -20,7 +20,17 @@ import {
} from "vue-property-decorator"; } from "vue-property-decorator";
@Component({ @Component({
components: {} components: {},
i18n: {
messages: {
'ZH-CN': {
without_group: '没有group属性无法分组',
},
'EN-US': {
without_group: 'Cannot group without group attribute',
}
}
}
}) })
export default class AppPointList extends Vue { export default class AppPointList extends Vue {
/** /**
......
...@@ -8,22 +8,22 @@ ...@@ -8,22 +8,22 @@
{{item.srfmajortext}} {{item.srfmajortext}}
</label> </label>
<div class="status_s"> <div class="status_s">
状态 {{$t('status')}}
</div> </div>
</div> </div>
<div class="list-hr"></div> <div class="list-hr"></div>
<div class="list03-box-line"> <div class="list03-box-line">
<div> <div>
<p class="typeinfo" v-if="item.subtitle">{{item.subtitle}}</p> <p class="typeinfo" v-if="item.subtitle">{{item.subtitle}}</p>
<p class="type-p">字段一</p> <p class="type-p">{{$t('field_one')}}</p>
</div> </div>
<div> <div>
<p class="typeinfo" v-if="item.content">{{item.content}}</p> <p class="typeinfo" v-if="item.content">{{item.content}}</p>
<p class="type-p">字段二</p> <p class="type-p">{{$t('field_two')}}</p>
</div> </div>
<div> <div>
<p class="typeinfo" v-if="item.time" >{{item.time.substr(0,10)}}</p> <p class="typeinfo" v-if="item.time" >{{item.time.substr(0,10)}}</p>
<p class="type-p">字段三</p> <p class="type-p">{{$t('field_three')}}</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -41,7 +41,23 @@ import { ...@@ -41,7 +41,23 @@ import {
} from "vue-property-decorator"; } from "vue-property-decorator";
@Component({ @Component({
components: {} components: {},
i18n: {
messages: {
'ZH-CN': {
status: '状态',
field_one: '字段一',
field_two: '字段二',
field_three: '字段三',
},
'EN-US': {
status: 'Status',
field_one: 'Field one',
field_two: 'Field two',
field_three: 'Field three',
}
}
}
}) })
export default class AppStatusList extends Vue{ export default class AppStatusList extends Vue{
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<div class="dropdown-item-text">{{item.label}}</div> <div class="dropdown-item-text">{{item.label}}</div>
</div> </div>
</div> </div>
<van-button class="dropdown-btn" @click="onReset" >重置</van-button> <van-button class="dropdown-btn" @click="onReset" >{{$t('reset')}}</van-button>
<van-button class="dropdown-btn" type="info" @click="onConfirm">确定</van-button> <van-button class="dropdown-btn" type="info" @click="onConfirm">{{$t('confirm')}}</van-button>
</van-dropdown-item> </van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</template> </template>
...@@ -24,7 +24,19 @@ import { ...@@ -24,7 +24,19 @@ import {
} from "vue-property-decorator"; } from "vue-property-decorator";
@Component({ @Component({
components: {} components: {},
i18n: {
messages: {
'ZH-CN': {
confirm: '确定',
reset: '重置',
},
'EN-US': {
confirm: 'Confirm',
reset: 'Reset',
}
}
}
}) })
export default class AppVanSelect extends Vue { export default class AppVanSelect extends Vue {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<van-step> <van-step>
<div class="step-item"> <div class="step-item">
<div class="step-start-user"> <div class="step-start-user">
<div class="step-text">发起申请</div> <div class="step-text">{{$t('start')}}</div>
<div class="step-start-user-name">{{data.startUserName}}</div> <div class="step-start-user-name">{{data.startUserName}}</div>
</div> </div>
<div class="step-start-time">{{data.startTime}}</div> <div class="step-start-time">{{data.startTime}}</div>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<template v-for="(usertask,index) in data.usertasks" > <template v-for="(usertask,index) in data.usertasks" >
<van-step v-if="usertask.identitylinks.length >0" :key="index+'identitylinks'"> <van-step v-if="usertask.identitylinks.length >0" :key="index+'identitylinks'">
<div class="step-start-user" > <div class="step-start-user" >
<div class="step-text">等待处理</div> <div class="step-text">{{$t('wait')}}</div>
<div class="step-start-user-name"> <div class="step-start-user-name">
<span v-for="(identitylink,inx) in usertask.identitylinks" :key="inx">{{identitylink.displayname}}<span v-if="inx >0"></span></span> <span v-for="(identitylink,inx) in usertask.identitylinks" :key="inx">{{identitylink.displayname}}<span v-if="inx >0"></span></span>
</div> </div>
...@@ -41,7 +41,21 @@ ...@@ -41,7 +41,21 @@
<script lang = 'ts'> <script lang = 'ts'>
import { Vue, Component, Prop, Model } from "vue-property-decorator"; import { Vue, Component, Prop, Model } from "vue-property-decorator";
@Component({}) @Component({
components: {},
i18n: {
messages: {
'ZH-CN': {
start: '发起申请',
wait: '等待处理',
},
'EN-US': {
start: 'Initiate an application',
wait: 'Waiting to be processed',
}
}
}
})
export default class AppWFApproval extends Vue { export default class AppWFApproval extends Vue {
/** /**
......
...@@ -49,6 +49,8 @@ import { DingTalkService } from '../../ibiz-core/third-party-service/DingTalkSer ...@@ -49,6 +49,8 @@ import { DingTalkService } from '../../ibiz-core/third-party-service/DingTalkSer
submit: '提交', submit: '提交',
usernametipinfo: '用户名为空', usernametipinfo: '用户名为空',
passwordtipinfo: '密码为空', passwordtipinfo: '密码为空',
dingdingfailed: '钉钉认证失败,请联系管理员',
badlogin: '登录异常',
}, },
'EN-US': { 'EN-US': {
username: 'User name', username: 'User name',
...@@ -56,6 +58,8 @@ import { DingTalkService } from '../../ibiz-core/third-party-service/DingTalkSer ...@@ -56,6 +58,8 @@ import { DingTalkService } from '../../ibiz-core/third-party-service/DingTalkSer
submit: 'Submit', submit: 'Submit',
usernametipinfo: 'User name is empty.', usernametipinfo: 'User name is empty.',
passwordtipinfo: 'Password id empty.', passwordtipinfo: 'Password id empty.',
dingdingfailed: 'Dingding authentication failed, please contact the administrator',
badlogin: 'Login exception',
} }
} }
} }
...@@ -110,7 +114,7 @@ export default class Login extends Vue { ...@@ -110,7 +114,7 @@ export default class Login extends Vue {
public async thirdLogin(){ public async thirdLogin(){
let loginStatus :any = await this.thirdPartyService.login(); let loginStatus :any = await this.thirdPartyService.login();
if(!loginStatus.issuccess){ if(!loginStatus.issuccess){
this.$notice.error(loginStatus.message?loginStatus.message:"钉钉认证失败,请联系管理员"); this.$notice.error(loginStatus.message?loginStatus.message:this.$t('dingdingfailed') + '' );
setTimeout(()=>{ setTimeout(()=>{
this.thirdPartyService.close(); this.thirdPartyService.close();
},1500); },1500);
...@@ -181,7 +185,7 @@ export default class Login extends Vue { ...@@ -181,7 +185,7 @@ export default class Login extends Vue {
} }
}).catch((error: any) => { }).catch((error: any) => {
this.isLoadding = false; this.isLoadding = false;
this.$notice.error(error?error.error.message:"登录异常"); this.$notice.error(error?error.error.message:this.$t('badlogin') + '');
}); });
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册