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