-
Notifications
You must be signed in to change notification settings - Fork 24
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
fix: Gracefully handle exceptions during direct i18n loading #628
Conversation
If translations.py doesn't exist, MCprep moves to direct i18n, which directly uses MO files for translations (at the cost of some UI updating issues). However, if these MO files do not exist, then MCprep will throw an exception. Since this exception occurs in the creation of `MCprepEnv`, MCprep is rendered unusable. This patch adds a basic try-except statement to allow `MCprepEnv` to handle these exceptions gracefully. Signed-off-by: Mahid Sheikh <[email protected]>
Can you share the code to auto run the translations again? ie the bash command so I can insert them into the push_latest.sh script. There I can do a check that makes it auto-quit if there are untracked changes (or, should we always just auto-commit machine translation updates?). In that PR I'll also fix the usage of bab instead of the old builder, rather confused how we didn't run into this in the last release. I was probably lucky and did a single non-dev build with bab locally before running the main script |
Sure
|
Hm that command was already there, but I guess it comes back down to it being the old pre-bab command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, changed base to dev as I'm going to make another commit change for the releaser script there.
Looks like it wasn't all the way graceful, had to pull the v3.6.1.1 release after publishign as testing the build locally now ran into this issue, which now seems to always trigger even with translations. Now I'm not even sure why the automated tests aren't catching this, since there are enable/disable tests that should be occurring. I'm less familiar with this module
Working on another patch for you to review. |
If translations.py doesn't exist, MCprep moves to direct i18n, which directly uses MO files for translations (at the cost of some UI updating issues). However, if these MO files do not exist, then MCprep will throw an exception. Since this exception occurs in the creation of
MCprepEnv
, MCprep is rendered unusable.This patch adds a basic try-except statement to allow
MCprepEnv
to handle these exceptions gracefully.