From 5bfcf911743300ee2b866fd8d5bebc32a2f3ec11 Mon Sep 17 00:00:00 2001 From: chriswang521 Date: Thu, 31 Aug 2023 13:42:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BF=9D=E7=95=99=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=95=B0=E6=8D=AE=E7=9B=B4=E6=8E=A5=E5=AE=89=E8=A3=85?= =?UTF-8?q?,=E9=A6=96=E6=AC=A1=E5=90=AF=E5=8A=A8=E5=90=8E=E9=87=8D?= =?UTF-8?q?=E8=BD=BD=E7=AA=97=E4=BD=93=E6=98=BE=E7=A4=BA=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/vs/base/node/languagePacks.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/vs/base/node/languagePacks.js b/src/vs/base/node/languagePacks.js index 11eaf41e..acb8afd6 100644 --- a/src/vs/base/node/languagePacks.js +++ b/src/vs/base/node/languagePacks.js @@ -113,10 +113,29 @@ const configFile = path.join(userDataPath, 'languagepacks.json'); try { if (!fs.existsSync(configFile)) { + console.log('languagepacks.json not exist'); let languagePack = generateLanguagePacks(); return languagePack; + } else { + let config = nodeRequire(configFile); + if (!config) { + return nodeRequire(configFile) + } + locale = resolveLanguagePackLocale(config, locale); + if (!locale) { + return nodeRequire(configFile); + } + const packConfig = config[locale]; + if (!packConfig || typeof packConfig.hash !== 'string') { + return nodeRequire(configFile); + } + if (packConfig.hash != 'd40608d6c84271a3245f89217f02df0a' && locale === 'zh-cn') { + let languagePack = generateLanguagePacks(); + return languagePack; + } + return nodeRequire(configFile); } - return nodeRequire(configFile); + // return nodeRequire(configFile); } catch (err) { // Do nothing. If we can't read the file we have no // language pack config.