From b04cc3ec74c74c335dffdfe2ec7d3461afe35150 Mon Sep 17 00:00:00 2001 From: tengge1 <930372551@qq.com> Date: Sat, 10 Aug 2019 20:06:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E7=A1=AE=E5=AE=9A=E5=88=9D=E5=A7=8B=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShadowEditor.Web/index.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ShadowEditor.Web/index.html b/ShadowEditor.Web/index.html index 75f8e792..8a80e97a 100644 --- a/ShadowEditor.Web/index.html +++ b/ShadowEditor.Web/index.html @@ -79,7 +79,17 @@ }; window.onload = () => { - var lang = window.localStorage.getItem('lang') || 'en-US'; + var lang = window.localStorage.getItem('lang'); + + if (!lang) { + var language = window.navigator.language.toLocaleLowerCase(); + + if (language === 'zh-cn') { + lang = 'zh-CN'; + } else { + lang = 'en-US'; + } + } if (lang === 'zh-CN') { loadJs('lang/zh-CN.js').then(() => {