-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Respect plugin's Domain Path when looking for translations for scripts
#9792
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
Respect plugin's Domain Path when looking for translations for scripts
#9792
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
jsnajdr
left a comment
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.
This patch looks good and it solves the issue: I tested it on my local plugin setup where I originally discovered it and the plugin-local translations that were originally missed are now loaded.
Thank you for fixing it so quickly 🚀
Summary
load_script_textdomain()did not consult a textdomain's registeredDomainPath(the custom path set byload_plugin_textdomain()/ the plugin header). As a result, JS translations required an explicit$pathtowp_set_script_translations()while PHP translations using__()honoredDomainPath.Changes
load_script_textdomain()now checks the registry path (if present) and tries loading translations from that path (human-readable filename first, then md5-hashed filename) before falling back toWP_LANG_DIRlookups.Trac ticket: https://core.trac.wordpress.org/ticket/63944
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.