desc: 提示国际化修改逻辑

This commit is contained in:
zyy 2019-09-30 16:13:59 +08:00
parent 25cb199850
commit 95877f344e
2 changed files with 7 additions and 8 deletions

View File

@ -6,7 +6,6 @@ import { getConverter } from '@/scripts/plugin/converter/manager';
import { sendTrainingNextStep } from '@/api/jmap/training';
import { Message } from 'element-ui';
import LangStorage from '@/utils/lang';
const lang = LangStorage.getLang();
var OperateHandler = function () {
};
@ -69,7 +68,7 @@ OperateHandler.prototype = {
// 编辑制作模式
if (this.getOperateBreakStatus()) {
valid = false;
const tip = lang == 'zh' ? '请输入提示并点击下一步' : 'Please enter a hint and click next';
const tip = LangStorage.getLang() == 'en' ? 'Please enter a hint and click next' : '请输入提示并点击下一步';
Message.error(tip);
this.operates.pop();
return valid;

View File

@ -3,7 +3,7 @@ import { TrainingMode } from '@/scripts/ConstDic';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import deviceType from '../../jmap/constant/deviceType';
import LangStorage from '@/utils/lang';
const lang = LangStorage.getLang();
// const lang = LangStorage.getLang();
/**
* 实训状态数据
*/
@ -291,9 +291,9 @@ const training = {
if (state.order >= state.steps.length) {
if (rtn && rtn.valid) {
commit('next');
commit('setOperateErrMsg', { errMsg: lang == 'zh' ? '操作正确!实训结束!' : 'Correct operation! Training is over!', color: 'green' });
commit('setOperateErrMsg', { errMsg: LangStorage.getLang() == 'en' ? 'Correct operation! Training is over!' : '操作正确!实训结束!', color: 'green' });
} else {
commit('setOperateErrMsg', { errMsg: lang == 'zh' ? '操作错误!实训结束!' : 'Operation error! Training is over!', color: 'red' });
commit('setOperateErrMsg', { errMsg: LangStorage.getLang() == 'en' ? 'Operation error! Training is over!' : '操作错误!实训结束!', color: 'red' });
}
dispatch('over');
dispatch('changeMode', { mode: null });
@ -341,7 +341,7 @@ const training = {
commit('setOperate', operate);
return new Promise((resolve, reject) => {
if (!state.started && !state.mode) {
commit('setOperateErrMsg', { errMsg: lang == 'zh' ? '请点击开始,开始实训!' : 'Please click start, start training!', color: 'red' });
commit('setOperateErrMsg', { errMsg: LangStorage.getLang() == 'en' ? 'Please click start, start training!' : '请点击开始,开始实训!', color: 'red' });
return;
}
@ -352,11 +352,11 @@ const training = {
if (TrainingMode.TEACH === state.mode || TrainingMode.PRACTICE === state.mode) {
if (rtn && rtn.valid) {
commit('next');
commit('setOperateErrMsg', { errMsg: lang == 'zh' ? '操作正确!真棒!' : "Correct operation! That's great!", color: 'green' });
commit('setOperateErrMsg', { errMsg: LangStorage.getLang() == 'en' ? "Correct operation! That's great!" : '操作正确!真棒!', color: 'green' });
commit('tipEventIncrement');
} else {
if (!operate.repeat) {
commit('setOperateErrMsg', { errMsg: lang == 'zh' ? '操作错误!' : 'operation mistake!', color: 'red' });
commit('setOperateErrMsg', { errMsg: LangStorage.getLang() == 'en' ? 'operation mistake!' : '操作错误!', color: 'red' });
}
}
} else if (TrainingMode.EXAM === state.mode || TrainingMode.TEST === state.mode) {