Skip to content

Commit 7eae511

Browse files
committed
allow localization to work on different contextbridge api keys
1 parent d43cbac commit 7eae511

3 files changed

Lines changed: 483 additions & 87 deletions

File tree

app/localization/i18n.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ i18n
1717
backend: {
1818
loadPath: prependPath + "/app/localization/locales/{{lng}}/{{ns}}.json",
1919
addPath: prependPath + "/app/localization/locales/{{lng}}/{{ns}}.missing.json",
20-
ipcRenderer: window.api.i18nextElectronBackend
20+
contextBridgeApiKey: "api" // needs to match first parameter of contextBridge.exposeInMainWorld in preload file; defaults to "api"
2121
},
2222
debug: false,
2323
namespace: "translation",
@@ -29,7 +29,7 @@ i18n
2929
});
3030

3131
window.api.i18nextElectronBackend.onLanguageChange((args) => {
32-
i18n.changeLanguage(args.lng, (error, t) => {
32+
i18n.changeLanguage(args.lng, (error, _t) => {
3333
if (error) {
3434
console.error(error);
3535
}

0 commit comments

Comments
 (0)