-
Notifications
You must be signed in to change notification settings - Fork 69
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
Compatibility Fix: Do not load translations early #9940
Compatibility Fix: Do not load translations early #9940
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.39 MB ℹ️ View Unchanged
|
The core payment gateway class only uses the `method_description` property within `get_method_description()`, a method that we are already overloading. This makes the `$this->method_description = $this->get_method_description()` call redundant, especially in the constructor.
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.
Left one comment. It is a nitpicky one. Feel free to ignore it. Overall, good work on this PR.
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.
The code changes look excellent.
I fully agree that this is a much-better approach to handling the translations fix.
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.
Code changes look good to me and I love the approach. I tested setting the language to Spanish and everything works well. Also, no more instances of Translation loading for the <code>woocommerce-payments</code> domain was triggered too early.
in the logs with this branch. 🚢
Fixes #9727
Changes proposed in this Pull Request
Based on #9884, to avoid also seeing Jetpack initialization warnings.
This PR is an alternative approach to @mordeth's idea to shuffle initialization, #9872. However, instead of re-ordering the whole initialization project, which seems a bit risky, this PR focuses on only loading translations at the right time.
Testing instructions
woocommerce-payments
translations being loaded too early._load_textdomain_just_in_time
was called incorrectly." warnings, but they should not be related to thewoocommerce-payments
domain.npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge