I18N: Add translator context to "Scale" strings in image editor#11405
I18N: Add translator context to "Scale" strings in image editor#11405sanketio wants to merge 1 commit intoWordPress:trunkfrom
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. |
Summary
The word "Scale" appears twice in
wp-admin/includes/image-edit.phpwith two distinct grammatical roles but both used the sameesc_html_e( 'Scale' )call with no translator context. In many languages (e.g. German: Skalierung vs. Skalieren), a noun and a verb require different translations, so translators were forced to pick one form for both usages.Changes
File:
src/wp-admin/includes/image-edit.phpReplaced both
esc_html_e( 'Scale' )calls withecho esc_html_x()to preserve HTML escaping while adding disambiguating context:echo esc_html_x( 'Scale', 'noun: label for the image scale controls panel', 'default' )echo esc_html_x( 'Scale', 'verb: button to apply image scaling', 'default' )Testing
tests/phpunit/tests/ajax/wpAjaxImageEditor.php) tests PHP save/restore logic, not HTML template output.esc_html_x()returnsScalein English exactly as before.Trac ticket: https://core.trac.wordpress.org/ticket/64983
Use of AI Tools
AI assistance: Yes
Tool(s): GitHub Copilot
Model(s): Claude Sonnet 4.6
Used for: Identifying affected code locations and composing the fix; final implementation was reviewed and edited by me.
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.