diff --git a/app/electron/main.js b/app/electron/main.js index d4fb124..e7bc9db 100644 --- a/app/electron/main.js +++ b/app/electron/main.js @@ -266,7 +266,15 @@ app.on("web-contents-created", (event, contents) => { // Disable Node.js integration webPreferences.nodeIntegration = false; }); - + // enable i18next translations in popup window + contents.on("did-create-window", (window) => { + i18nextBackend.mainBindings(ipcMain, window, fs); + }); + // destroy bindings on popup window closed + contents.on("destroyed", () => { + i18nextBackend.clearMainBindings(ipcMain); + }); + // https://electronjs.org/docs/tutorial/security#13-disable-or-limit-creation-of-new-windows // This code replaces the old "new-window" event handling; // https://github.com/electron/electron/pull/24517#issue-447670981 @@ -291,4 +299,4 @@ app.on("web-contents-created", (event, contents) => { action: "allow" }; }); -}); \ No newline at end of file +});