From 0a3b6a331ddd1d0321bc6930d6717f1df5493ea6 Mon Sep 17 00:00:00 2001 From: chriswang521 Date: Thu, 31 Aug 2023 19:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=AF=E5=8A=A8=E9=94=99?= =?UTF-8?q?=E8=AF=AF.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/vs/base/node/languagePacks.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vs/base/node/languagePacks.js b/src/vs/base/node/languagePacks.js index acb8afd6..c4c09579 100644 --- a/src/vs/base/node/languagePacks.js +++ b/src/vs/base/node/languagePacks.js @@ -107,9 +107,10 @@ /** * @param {string} userDataPath + * @param {string} locale * @returns {object} */ - function getLanguagePackConfigurations(userDataPath) { + function getLanguagePackConfigurations(userDataPath, locale) { const configFile = path.join(userDataPath, 'languagepacks.json'); try { if (!fs.existsSync(configFile)) { @@ -119,7 +120,7 @@ } else { let config = nodeRequire(configFile); if (!config) { - return nodeRequire(configFile) + return nodeRequire(configFile); } locale = resolveLanguagePackLocale(config, locale); if (!locale) { @@ -129,7 +130,7 @@ if (!packConfig || typeof packConfig.hash !== 'string') { return nodeRequire(configFile); } - if (packConfig.hash != 'd40608d6c84271a3245f89217f02df0a' && locale === 'zh-cn') { + if (packConfig.hash !== 'd40608d6c84271a3245f89217f02df0a' && locale === 'zh-cn') { let languagePack = generateLanguagePacks(); return languagePack; } @@ -139,6 +140,7 @@ } catch (err) { // Do nothing. If we can't read the file we have no // language pack config. + console.log('getLanguagePackConfigurations error:' + err); } return undefined; } @@ -203,7 +205,7 @@ if (!commit) { return defaultResult(initialLocale); } - const configs = getLanguagePackConfigurations(userDataPath); + const configs = getLanguagePackConfigurations(userDataPath, locale); if (!configs) { return defaultResult(initialLocale); }