The plugin was loading translations too early on plugins_loaded. Plugins should wait until init to ensure the current user has been set up, so that the current user's locale can be respected.
That said, why manually load translations when WordPress can do it for you :-)
Summary
This PR can be summarized in the following changelog entry:
Improves how the translations are loaded by relying on the WordPress mechanism for that. Props to @swissspidy.
Relevant technical choices:
See above
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Set a language which has 100% of the translations (see the list)
visit Settings > Duplicate Post and check that all the strings are translated
visit the Post list and check that the row actions, the bulk actions and the column header are translated
edit a post and check that the "Copy to a new draft" and "Rewrite and Republish" button are translated
also check that the admin bar menu is translated
also check that the plugin entry in the plugin list is translated
Relevant test scenarios
[ ] Changes should be tested with the browser console open
[ ] Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
[ ] Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
[ ] Changes should be tested on different browsers
[ ] Changes should be tested on multisite
Test instructions for QA when the code is in the RC
[x] QA should use the same steps as above.
QA can test this PR by following these steps:
*
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
*
UI changes
[ ] This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.
Documentation
[ ] I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.
Quality assurance
[x] I have tested this code to the best of my abilities
[ ] I have added unittests to verify the code works as intended
Innovation
[x] No innovation project is applicable for this PR.
[ ] This PR falls under an innovation project. I have attached the innovation label and noted the work hours.
Context
The plugin was loading translations too early on
plugins_loaded
. Plugins should wait untilinit
to ensure the current user has been set up, so that the current user's locale can be respected.That said, why manually load translations when WordPress can do it for you :-)
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Relevant test scenarios
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
*
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
*
UI changes
Documentation
Quality assurance
Innovation
innovation
label and noted the work hours.Fixes #