hobbyquaker / arcticfox-config

Configuration Tool for Vape Battery Mods with Arcticfox Firmware. :cloud: :wrench: Works on MacOS and Linux.
GNU General Public License v3.0
66 stars 7 forks source link

Missing i18n/.json file when starting the app #26

Closed febs closed 6 years ago

febs commented 7 years ago

Hello.

This is more a glitch than a bug afaik, but still, this might be helpful. At every run, I get this message polluting the terminal output.

fabio@fabiolaptop:~/devel/Vape$ arcticfox-config
{ Error: ENOENT, i18n/.json not found in /opt/Arcticfox Config/resources/app.asar
    at notFoundError (ELECTRON_ASAR.js:115:19)
    at Object.fs.readFileSync (ELECTRON_ASAR.js:514:9)
    at Object.<anonymous> (/opt/Arcticfox Config/resources/app.asar/main.js:454:26)
    at Object.<anonymous> (/opt/Arcticfox Config/resources/app.asar/main.js:471:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Object.<anonymous> (/opt/Arcticfox Config/resources/electron.asar/browser/init.js:171:8) code: 'ENOENT', errno: -2 }

Thanks,

Dil3mm4 commented 7 years ago

Creating a .json with this content on nano {} Fixed the issue.

Further infos: The problem it's probably caused by app.getLocale() not doing it's job. https://github.com/hobbyquaker/arcticfox-config/blob/05ca304bf8d7145acf12fa143fe98eae4fdeb70b/main.js#L452 That's the line that generates the bug.

Dil3mm4 commented 6 years ago

@hobbyquaker is the app.getlocale routine broke sometimes due to different OS?

hobbyquaker commented 6 years ago

possibly. To be honest - I don't know from where electron's getLocale() gets the country information. But hmm... perhaps I should reopen this issue, a fallback to english isn't a real fix, just a workaround. Will investigate.

Dil3mm4 commented 6 years ago

Depends on l10n_util to get the locale

hobbyquaker commented 6 years ago

I guess the mistake is not to wait for the ready event: https://github.com/electron/electron/issues/9902