fix: LC_ALL env should not be changed (#26507)
This commit is contained in:
parent
968cb970fc
commit
cc136f2acd
3 changed files with 42 additions and 12 deletions
10
spec/fixtures/api/locale-check/main.js
vendored
10
spec/fixtures/api/locale-check/main.js
vendored
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue