63657db3be
Just use the english locale for now. Load locale data from the filesystem in the main process and pass it to the renderer preload script via ipc. Note that we need the locale data to be available by the time view scripts are loaded. // FREEBIE
13 lines
395 B
JavaScript
13 lines
395 B
JavaScript
/*
|
|
* Pending electron 1.6.x
|
|
* const env = require('url').parse(window.location, true).query;
|
|
*/
|
|
|
|
window.env = {};
|
|
window.location.search.substring(1).split('&').forEach(function(variable) {
|
|
var pair = variable.split('=');
|
|
env[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
|
|
});
|
|
|
|
const ipc = require('electron').ipcRenderer
|
|
window.env.locale_json = ipc.sendSync('locale-data');
|