-
-
Notifications
You must be signed in to change notification settings - Fork 387
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
PICARD-2870: Get rid of monkeypatched gettext-related builtins #2421
Conversation
_ is missing from generated ui files, not sure about how to handle it |
Not the greatest solution, but could you perhaps include the necessary include in the comment text added when the ui is built using the Lines 380 to 394 in 0858846
Another "hack" might be to add the necessary include if it is missing when building the application. Unfortunately, neither of these will help if the ui was generated without |
69d8a76
to
2aebd61
Compare
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.
I believe that this is a real improvement. Thanks for all the refactoring changes to implement it. This looks great to me.
It will let do: from picard.i18n import gettext or from picard.i18n import gettext as _
@phw as discussed, So, may be, keep fc87e6c but drop 7db3d00 Plus I'll have to re-order all imports... for tests to pass @rdswift what's your opinion on this? |
I don't think it hurts anything by having the extra flexibility, but as you say it could be confusing to use |
It was more about 7db3d00 which spreads |
Sorry, I misunderstood. I don't really have any issues with it either way. |
41ed1a0
to
04f9c0e
Compare
04f9c0e
to
134cfce
Compare
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.
Huge changelist, but looks good.
Let's also update the translations once this got merged.
Summary
Problem
Those gettext-related methods defined as builtins (monkeypatching) leads to a certain number of issues.
For example, static typing checkers like mypy have issues with those (see python/mypy#8727).
We also have exceptions in various tools configurations (pylint for example) for those.
Solution
Import those methods from picard.i18n
It will break plugins, but since 3.0 will break plugins anyway... time to do it.
Action
Additional actions required: