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

多语言 组件i18n国际化支持

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