fix: LC_ALL env should not be changed (#26507)

This commit is contained in:
Cheng Zhao 2020-11-18 11:13:01 +09:00 committed by GitHub
parent 968cb970fc
commit cc136f2acd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 12 deletions

View file

@ -1,10 +1,16 @@
const { app } = require('electron');
const locale = process.argv[2].substr(11);
app.commandLine.appendSwitch('lang', locale);
if (locale.length !== 0) {
app.commandLine.appendSwitch('lang', locale);
}
app.whenReady().then(() => {
process.stdout.write(app.getLocale());
if (process.argv[3] === '--print-env') {
process.stdout.write(String(process.env.LC_ALL));
} else {
process.stdout.write(app.getLocale());
}
process.stdout.end();
app.quit();