From a96bb42ebc24c7dfd286481a12a953e211ff88e4 Mon Sep 17 00:00:00 2001
From: tengge1 <930372551@qq.com>
Date: Sat, 3 Aug 2019 20:36:25 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=AD=E8=A8=80=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ShadowEditor.Web/lang/zh-CN.js | 3 ++-
.../src/editor2/menu/OptionsMenu.jsx | 18 ++++++++++++++++++
ShadowEditor.Web/src/language/Language.js | 1 +
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/ShadowEditor.Web/lang/zh-CN.js b/ShadowEditor.Web/lang/zh-CN.js
index 80c19993..e3a27f3a 100644
--- a/ShadowEditor.Web/lang/zh-CN.js
+++ b/ShadowEditor.Web/lang/zh-CN.js
@@ -634,4 +634,5 @@ L_PARTITION_DIAGRAM = '分区图';
L_DIG = '挖坑';
L_EDIT_SCRIPT = '编辑脚本';
L_DELETE_SCRIPT = '删除脚本';
-L_SCALE_LOCKED = '锁定缩放';
\ No newline at end of file
+L_SCALE_LOCKED = '锁定缩放';
+L_LANGUAGE = '语言';
\ No newline at end of file
diff --git a/ShadowEditor.Web/src/editor2/menu/OptionsMenu.jsx b/ShadowEditor.Web/src/editor2/menu/OptionsMenu.jsx
index f3b545bb..783f0942 100644
--- a/ShadowEditor.Web/src/editor2/menu/OptionsMenu.jsx
+++ b/ShadowEditor.Web/src/editor2/menu/OptionsMenu.jsx
@@ -12,6 +12,8 @@ class OptionsMenu extends React.Component {
this.handleRendererOptions = this.handleRendererOptions.bind(this);
this.handleHelperOptions = this.handleHelperOptions.bind(this);
this.handleFilterOptions = this.handleFilterOptions.bind(this);
+ this.handleChangeEnglish = this.handleChangeEnglish.bind(this);
+ this.handleChangeChinese = this.handleChangeChinese.bind(this);
}
render() {
@@ -23,6 +25,10 @@ class OptionsMenu extends React.Component {
+
;
}
@@ -77,6 +83,18 @@ class OptionsMenu extends React.Component {
this.optionsWindow.show();
this.optionsWindow.changeTab(L_FILTER);
}
+
+ // ---------------------------- 语言选项 -------------------------------------------------
+
+ handleChangeEnglish() {
+ window.localStorage.setItem('lang', 'en-US');
+ window.location.reload();
+ }
+
+ handleChangeChinese() {
+ window.localStorage.setItem('lang', 'zh-CN');
+ window.location.reload();
+ }
}
export default OptionsMenu;
\ No newline at end of file
diff --git a/ShadowEditor.Web/src/language/Language.js b/ShadowEditor.Web/src/language/Language.js
index 8ef9c460..94cbf4a8 100644
--- a/ShadowEditor.Web/src/language/Language.js
+++ b/ShadowEditor.Web/src/language/Language.js
@@ -633,4 +633,5 @@ Object.assign(window, {
L_EDIT_SCRIPT: 'Edit Script',
L_DELETE_SCRIPT: 'Delete Script',
L_SCALE_LOCKED: 'Scale Locked',
+ L_LANGUAGE: 'Language',
});
\ No newline at end of file