electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.46k stars 1.71k forks source link

Unable to reach i18n json files through installed version #8228

Closed szigetib95 closed 1 month ago

szigetib95 commented 1 month ago

I'm facing an issue in my current electron application where the frontend is written in angular and we are providing default path information about the i18n resources i.e. 'en.json' where we are trying to access the files through assets/i18n folder. It causes the internationalization being broken and only shows the keys instead of values. When I'm building locally its able to find the resources without any problems. During building to windows with NSIS, I got that its creating an app.asar archive that will contain all my bundled code regarding angular and electron aswell. Since I've installed the application is still looking for the same path, and the files are there in the given path, but seems like it cannot identify the json format inside the asar, so I modified the configuration in my app to build the resource files outside of the app.asar. But now I'm stuck with two things:

  1. how to get the right path to this folder outside of app.asar file
  2. pass this path to my angular application and set this path when we are running it in production specially to windows.
szigetib95 commented 1 month ago

I was able to fix this issue by removing a probably outdated dependency and rebuild the whole env, it took only 1-2 weeks to find out the solutions.