Skip to content

I18N: Use _x() with verb context for translatable 'Reply' strings#11406

Open
sanketio wants to merge 1 commit intoWordPress:trunkfrom
sanketio:fix/64984
Open

I18N: Use _x() with verb context for translatable 'Reply' strings#11406
sanketio wants to merge 1 commit intoWordPress:trunkfrom
sanketio:fix/64984

Conversation

@sanketio
Copy link
Copy Markdown

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 default reply_text in get_comment_reply_link().
  • src/js/_enqueues/admin/edit-comments.js — Expose wp.i18n._x alongside wp.i18n.__, and use _x() for both Reply button text assignments.

Testing

  1. Verify the comments admin screens (/wp-admin/edit-comments.php) still show "Reply" buttons correctly.
  2. Verify the comment reply link renders correctly on the front end.
  3. Verify the dashboard Recent Comments widget still shows a "Reply" action link.
  4. Optionally: confirm the new verb context appears in GlotPress under the wp/dev project 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.

@github-actions
Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props sanketparmar.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants