electron/spec/fixtures/api/locale-check/main.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
386 B
JavaScript
Raw Normal View History

2018-09-13 16:10:51 +00:00
const { app } = require('electron');
const locale = process.argv[2].substr(11);
if (locale.length !== 0) {
app.commandLine.appendSwitch('lang', locale);
}
app.whenReady().then(() => {
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();
});