mirror of
https://github.com/electron/electron.git
synced 2026-02-16 01:56:59 -05:00
18 lines
386 B
JavaScript
18 lines
386 B
JavaScript
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();
|
|
});
|