fixed:解决安装其他显示语言,重启后不生效.

This commit is contained in:
chriswang521 2024-06-13 13:46:10 +08:00 committed by wangpenglong
parent 3af3ef081c
commit e3e4607fce
1 changed files with 4 additions and 1 deletions

View File

@ -111,6 +111,9 @@
async function getLanguagePackConfigurations(userDataPath, locale) { async function getLanguagePackConfigurations(userDataPath, locale) {
const configFile = path.join(userDataPath, 'languagepacks.json'); const configFile = path.join(userDataPath, 'languagepacks.json');
try { try {
if (locale !== 'zh-cn') {
return JSON.parse(await readFile(configFile));
}
if (!fs.existsSync(configFile)) { if (!fs.existsSync(configFile)) {
console.log('languagepacks.json not exist'); console.log('languagepacks.json not exist');
let languagePack = generateLanguagePacks(); let languagePack = generateLanguagePacks();
@ -118,7 +121,7 @@
} else { } else {
let config = require(configFile); let config = require(configFile);
if (!config) { if (!config) {
return JSON.parse(await readFile(configFile));; return JSON.parse(await readFile(configFile));
} }
locale = resolveLanguagePackLocale(config, locale); locale = resolveLanguagePackLocale(config, locale);
if (!locale) { if (!locale) {