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); }