From 20a830e35ea8c571ea2f4e7c95e081f33651475c Mon Sep 17 00:00:00 2001 From: fangxiang Date: Thu, 14 Jul 2022 09:55:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=B5=8B=E5=88=B0=E4=BC=98=E9=9C=B8?= =?UTF-8?q?=E5=AE=9A=E5=88=B6=E6=97=B6=E5=BC=BA=E5=88=B6=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E4=B8=BA=E8=8B=B1=E6=96=87=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E5=AF=BC=E5=85=A5=E5=A4=87=E4=BB=BD=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=97=B6=E8=8B=B1=E6=96=87=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/Initializer.ts | 14 ++++++++++++++ src/i18n/en-US/index.ts | 1 + src/store/index.ts | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/common/Initializer.ts b/src/common/Initializer.ts index 426e288..eb3275d 100644 --- a/src/common/Initializer.ts +++ b/src/common/Initializer.ts @@ -3,6 +3,7 @@ import GlobalData from "src/common/GlobalData"; import { Common } from "./Common"; import EventBus, { EventNamesDefine } from "./EventBus"; import OptionsType from "./OptionsType"; +import { Cookies } from "quasar"; export default class Initializer { private options: OptionsType; @@ -193,6 +194,19 @@ export default class Initializer { .then((response) => { if (response && typeof response.attribute != "undefined") { $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(); + } + } } }); } diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index bd8559e..d61d535 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -294,4 +294,5 @@ export default { "edit group": "Edit Group", "open window": "Open Window", "close all windows": "Close All Windows", + "select data(DBP) file": "Select Data(DBP) File", }; diff --git a/src/store/index.ts b/src/store/index.ts index b95dfb3..8c5a3d9 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -337,13 +337,13 @@ export default store(function (/* { ssrContext } */) { setAvancedDebug(state: StateInterface, playload?: any) { if (playload || playload == "true") { console.log("debug", playload); + state.advanced_debug = playload; } state.advanced_debug = playload; }, setFactoryMode(state: StateInterface, playload?: any) { if (playload || playload == "true") { console.log("factory", playload); - state.advanced_debug = playload; } state.factory_mode = playload; },