fixed:解决安装其他显示语言,重启后不生效.
This commit is contained in:
parent
3af3ef081c
commit
e3e4607fce
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue