2020-03-20 14:28:31 -06:00
|
|
|
const { app } = require('electron');
|
2018-02-08 07:26:37 -07:00
|
|
|
|
2020-10-28 10:18:47 -06:00
|
|
|
const locale = process.argv[2].substr(11);
|
2020-11-17 19:13:01 -07:00
|
|
|
if (locale.length !== 0) {
|
|
|
|
app.commandLine.appendSwitch('lang', locale);
|
|
|
|
}
|
2020-10-28 10:18:47 -06:00
|
|
|
|
2020-02-03 15:43:22 -07:00
|
|
|
app.whenReady().then(() => {
|
2020-11-17 19:13:01 -07:00
|
|
|
if (process.argv[3] === '--print-env') {
|
|
|
|
process.stdout.write(String(process.env.LC_ALL));
|
|
|
|
} else {
|
2022-11-09 08:50:43 -07:00
|
|
|
process.stdout.write(`${app.getLocale()}|${app.getSystemLocale()}|${JSON.stringify(app.getPreferredSystemLanguages())}`);
|
2020-11-17 19:13:01 -07:00
|
|
|
}
|
2020-03-20 14:28:31 -06:00
|
|
|
process.stdout.end();
|
2018-02-08 07:26:37 -07:00
|
|
|
|
2020-03-20 14:28:31 -06:00
|
|
|
app.quit();
|
|
|
|
});
|