You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that defining a custom contextBridgeApiKey in the options different to "api" (and placing the bindings there), this error is always triggered...
In my setup, I was abstracting the i18n setup placing it in window.__i18n instead of the default window.api...
If I set it on api, it works.
As the backend constructor calls this.init()here but the options haven't been set yet, it checks for the existence of window.api.i18nextElectronBackend by default... which is never going to exist because it should be defined in the custom key (window.__i18n.i18nextElectronBackend in my case).
Just commenting the call to this.init() fixes the problem... but I don't know if this call is needed for any compatibility issue with older versions of i18next...
The text was updated successfully, but these errors were encountered:
danikaze
added a commit
to danikaze/i18next-electron-fs-backend
that referenced
this issue
Aug 21, 2024
I found that defining a custom
contextBridgeApiKey
in the options different to"api"
(and placing the bindings there), this error is always triggered...In my setup, I was abstracting the i18n setup placing it in
window.__i18n
instead of the defaultwindow.api
...If I set it on
api
, it works.Based on my investigation, I found that
i18next
works creating an instance of the backend first with default options (no options), and then it callsinstance.init()
here with the proper options.As the backend constructor calls
this.init()
here but the options haven't been set yet, it checks for the existence ofwindow.api.i18nextElectronBackend
by default... which is never going to exist because it should be defined in the custom key (window.__i18n.i18nextElectronBackend
in my case).Just commenting the call to this.init() fixes the problem... but I don't know if this call is needed for any compatibility issue with older versions of i18next...
The text was updated successfully, but these errors were encountered: