检测到优霸定制时强制设置语言为英文

修正导入备份文件时英文翻译
This commit is contained in:
fangxiang 2022-07-14 09:55:51 +08:00
parent 15b7d0c143
commit 20a830e35e
3 changed files with 16 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import GlobalData from "src/common/GlobalData";
import { Common } from "./Common"; import { Common } from "./Common";
import EventBus, { EventNamesDefine } from "./EventBus"; import EventBus, { EventNamesDefine } from "./EventBus";
import OptionsType from "./OptionsType"; import OptionsType from "./OptionsType";
import { Cookies } from "quasar";
export default class Initializer { export default class Initializer {
private options: OptionsType; private options: OptionsType;
@ -193,6 +194,19 @@ export default class Initializer {
.then((response) => { .then((response) => {
if (response && typeof response.attribute != "undefined") { if (response && typeof response.attribute != "undefined") {
$store.commit("setDeviceAttribute", response.attribute); $store.commit("setDeviceAttribute", response.attribute);
if (response.attribute & Protocol.EDeviceAttribute.CustomISV) {
let language = Cookies.get("language");
if (!language) {
language = "zh-CN";
}
if (language != "en-US") {
Cookies.set("language", "en-US", {
expires: 365,
});
window.location.reload();
}
}
} }
}); });
} }

View File

@ -294,4 +294,5 @@ export default {
"edit group": "Edit Group", "edit group": "Edit Group",
"open window": "Open Window", "open window": "Open Window",
"close all windows": "Close All Windows", "close all windows": "Close All Windows",
"select data(DBP) file": "Select Data(DBP) File",
}; };

View File

@ -337,13 +337,13 @@ export default store(function (/* { ssrContext } */) {
setAvancedDebug(state: StateInterface, playload?: any) { setAvancedDebug(state: StateInterface, playload?: any) {
if (playload || playload == "true") { if (playload || playload == "true") {
console.log("debug", playload); console.log("debug", playload);
state.advanced_debug = playload;
} }
state.advanced_debug = playload; state.advanced_debug = playload;
}, },
setFactoryMode(state: StateInterface, playload?: any) { setFactoryMode(state: StateInterface, playload?: any) {
if (playload || playload == "true") { if (playload || playload == "true") {
console.log("factory", playload); console.log("factory", playload);
state.advanced_debug = playload;
} }
state.factory_mode = playload; state.factory_mode = playload;
}, },