-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working - am I missing something? #13
Comments
Hi @paddotk, you can take a peak at secure-electron-template as an example of how this can be integrated, but in short, here's how the package functions. high level overviewsummaryi18next-electron-fs-backend is a custom i18next backend to return translations in a "renderer" (ie. view) in an Electron app. Since for Electron apps to be secure, the renderer and main processes need to be split. The responsibility of the main process will be to use The renderer process gets the code to send IPC messages when you call the Now, since you've defined your i18next config file with this i18next-electron-fs-backend backend, anytime the renderer process tries to access a translation, it's going to make an IPC request that will be received by the main process. The main process's IPC bindings are configured by the The basic flow is:
You should not need to use |
@tustin2121, another user reported issues of using |
I thank you for the update. Looking at the changelog, it probably would work for me, but I can't test it specifically anymore. After I made the above comment, I forked the repo with intent on trying to maybe make something to put into a pull request. Simply removing the check that you updated in the latest version was enough for it to function for testing in my app, but I ran into other unrelated issues with i18next and its async nature, so I ended up abandoning the base library in favor of a more custom solution. But if I go back to i18next later or in another project, the update will be greatly appreciated. Thanks. |
Hi,
I've followed the readme, and additionally installed the
i18next
andreact-i18next
packages. The 'fs' module can still not be used in Electron though. It's unclear how to use the config that has this code:but I saved in a separate file called i18n.config.js and import it in my index.html file.
The devtools console does show a
i18next initialized
message and object, but I still can't usefs
. Could you please elaborate on how this should be used?The text was updated successfully, but these errors were encountered: