Make WordPress Core

Opened 6 weeks ago

Closed 3 days ago

#64984 closed defect (bug) (fixed)

reply needs gettext

Reported by: timse201's profile timse201 Owned by: audrasjb's profile audrasjb
Milestone: 7.0 Priority: normal
Severity: normal Version: trunk
Component: I18N Keywords: fixed-major dev-reviewed i18n-change
Focuses: Cc:

Change History (15)

#1 @audrasjb
6 weeks ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to 7.0

To be clear, what is needed here is a context for translators, using the _x() function.
See https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#disambiguation-by-context

#2 @audrasjb
6 weeks ago

  • Version set to trunk

This ticket was mentioned in PR #11406 on WordPress/wordpress-develop by @sanket.parmar.


6 weeks ago
#3

  • Keywords has-patch added; needs-patch removed

## 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 ticket was mentioned in Slack in #core by audrasjb. View the logs.


6 weeks ago

#5 @audrasjb
6 weeks ago

  • Keywords commit added
  • Owner set to audrasjb
  • Status changed from new to accepted

LGTM.

#6 @audrasjb
6 weeks ago

  • Keywords changes-requested added; good-first-bug commit removed

Removing commit.
This needs to be also fixed on Gutenberg's side, too.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


12 days ago

#8 @audrasjb
12 days ago

  • Keywords commit added; changes-requested removed

As per today's bug scrub: This needs to be fixed on Gutenberg side too, but we can always commit this patch in Core, and open a GB PR in parallel.
Re-adding commit keyword.

#9 @shailu25
9 days ago

Gutenberg PR Link 77891

#10 @wildworks
7 days ago

Gutenberg PR Link 77891

The Gutenberg PR has been merged and backported to 7.0.

#11 @jorbin
4 days ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 62324:

I18N: Add translator context to the use of "Reply".

Props timse201, audrasjb, sanketparmar.
Fixes #64984.

#12 @jorbin
4 days ago

  • Keywords dev-feedback fixed-major added; has-patch commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backport consideration.

#13 @audrasjb
4 days ago

  • Keywords dev-reviewed added; dev-feedback removed

This is a second committer sign-off.

#14 @audrasjb
4 days ago

  • Keywords i18n-change added

#15 @desrosj
3 days ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 62331:

I18N: Add translator context to the use of "Reply".

Reviewed by audrasjb, desrosj.
Merges [62324] to the 7.0 branch.

Props timse201, audrasjb, sanketparmar, jorbin, desrosj.
Fixes #64984.

Note: See TracTickets for help on using tickets.