WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#37779 closed defect (bug) (invalid)

Replace _x() with __() and translators comments in wp-login.php

Reported by: ramiy Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch
Focuses: Cc:
PR Number:

Description

Context function _x() is used to differ two similar strings with different meanings. Translators comments are used to describe %s placeholders.

The attached patch is replacing:

/* translators: %s: site title */
_x( '← Back to %s', 'site' )

with:

/* translators: %s: site title */
__( '← Back to %s' )

There is only one string of this kind. We don't need to use context functions in here. And the %s placeholder is described in translators comments, not in the context area.

Attachments (2)

37779.png (37.1 KB) - added by ramiy 3 years ago.
37779.patch (518 bytes) - added by ramiy 3 years ago.

Download all attachments as: .zip

Change History (6)

@ramiy
3 years ago

@ramiy
3 years ago

#1 @ramiy
3 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

The context is intentional here, see #37095.

#3 @ramiy
3 years ago

@SergeyBiryukov Those are two different po/mo files. One string is in ru_RU.mo and the other is in admin-ru_RU.mo.

#4 @SergeyBiryukov
3 years ago

If the same string is used both on the front end an in the admin, it only exists in the general (non-admin) translation file. The translation in the admin was incorrect because of that.

We could remove the context in wp-login.php and keep it in wp-admin/edit-tag-form.php, but I'd prefer to keep it on both strings for clarity.

Note: See TracTickets for help on using tickets.