-
Notifications
You must be signed in to change notification settings - Fork 888
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
Ensure updated locales are auto-reloaded in electron renderer dev mode #4066
Ensure updated locales are auto-reloaded in electron renderer dev mode #4066
Conversation
981f4e9
to
e2f4665
Compare
Didn't mean to click that. I haven't tested this yet, but I don't think this change will do what you think it will, as FreeTube itself caches them too, it only loads each locale once. So you'll need changes inside FreeTube along with the webpack ones. https://github.com/FreeTubeApp/FreeTube/blob/development/src/renderer/i18n/index.js#L14-L18 Also have you tested a release build |
Watch external file plugin now only added in dev mode But I have tested the behaviour with multiple locales and it's working for me |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
dd2beed
to
07da6d0
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
07da6d0
to
1c833e2
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
Note to self: test after @absidue review is in |
Okay, so it works and as I suspected, it does so by reloading the entire application, basically the same that would happen when you open a new window, so very expensive but at least it works. Just remember not to change any strings while you are on the subscriptions page and have automatic subscription fetching enabled, otherwise you'll have fun with your screen filled with falling back to RSS toasts after a few edits. Maybe in the future we can look into a more efficient solution but for now this works. |
* development: (26 commits) Translated using Weblate (Portuguese) Ensure updated locales are auto-reloaded in electron renderer dev mode (FreeTubeApp#4066) Translated using Weblate (Portuguese) Translated using Weblate (Russian) Translated using Weblate (Latvian) Added translation using Weblate (Latvian) Translated using Weblate (Portuguese) Bump sass from 1.69.3 to 1.69.4 (FreeTubeApp#4216) Bump the stylelint group with 1 update (FreeTubeApp#4214) Bump the eslint group with 2 updates (FreeTubeApp#4213) Bump vue from 2.7.14 to 2.7.15 (FreeTubeApp#4217) Bump electron from 27.0.0 to 27.0.2 (FreeTubeApp#4215) Translated using Weblate (Portuguese) Add logo hover styling (FreeTubeApp#4209) Translated using Weblate (Portuguese) Translated using Weblate (Portuguese) Translated using Weblate (Portuguese) Update CONTRIBUTING.md (FreeTubeApp#4208) Translated using Weblate (Portuguese) Translated using Weblate (Samoan) ...
Pull Request Type
Related issue
Description
Ensure updated locales are auto-reloaded in electron renderer dev mode
Webpack does not watch locale files to rebuild
So added
webpack-watch-external-files-plugin
Also updated internal locale processing plugin to only read changed files (mtime comparison)
Screenshots
Limited emit for locale JSON after en-US.yaml changed
No emit for locale JSON after renderer file changed
Testing
Basic
yarn && yarn dev
You have disabled automatic subscription fetching
)Fix locales getting unnecessarily reprocessed for incremental builds
See #3893
Build
yarn && yarn pack:renderer
yarn && yarn build
Desktop
Additional context
activeLocales.json
(it's rarely changed in dev)scripts/ProcessLocalesPlugin.js