I18N: Use _x() with verb context for translatable 'Reply' strings#11406
I18N: Use _x() with verb context for translatable 'Reply' strings#11406sanketio 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
Fixes the ambiguous translation of the string
'Reply'used as a button/link label in comments UI. In some languages (e.g., German), "Reply" as a noun and as an imperative verb translate differently. Without a translator context, GlotPress cannot distinguish between uses, leading to mistranslations.Replaces all
__( 'Reply' )occurrences with_x( 'Reply', 'verb' )and adds/* translators: */docblock comments, consistent with the existing pattern used for_x( 'Spam', 'verb' )in the same codebase.Changes
src/wp-admin/includes/dashboard.php— Use_x()for Reply button in dashboard comment actions.src/wp-admin/includes/class-wp-comments-list-table.php— Use_x()for Reply button in comments list table row actions.src/wp-includes/comment-template.php— Use_x()for defaultreply_textinget_comment_reply_link().src/js/_enqueues/admin/edit-comments.js— Exposewp.i18n._xalongsidewp.i18n.__, and use_x()for both Reply button text assignments.Testing
/wp-admin/edit-comments.php) still show "Reply" buttons correctly.verbcontext appears in GlotPress under thewp/devproject strings for'Reply'.Trac ticket: https://core.trac.wordpress.org/ticket/64984
Use of AI Tools
AI assistance: Yes
Tool(s): GitHub Copilot
Model(s): Claude Sonnet 4.6
Used for: Identifying all affected locations, implementing the
_x()replacements, and drafting this PR description; changes were reviewed before submission.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.