WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 3 months ago

#50740 closed defect (bug) (fixed)

i18n: Merge similar translation strings in privacy request statuses

Reported by: ramiy Owned by: whyisjake
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-screenshots has-patch
Focuses: administration Cc:

Description

The wp-includes/post.php file has a create_initial_post_types() function that registers initial post types & statuses.

When registering Privacy Statuses (Pending, Confirmed, Failed, Completed), translation string use _x() context function.

Below we have the _wp_privacy_statuses() function that returns privacy statuses. This function uses regular __() function without any context.

The same 4 strings have 8 translation strings in the translate system bloating the total number of translation strings.

We can merge those translation strings by using context functions inside _wp_privacy_statuses().

See the screenshot from the translation system and the attached patch.

Attachments (6)

50740a.png (8.3 KB) - added by ramiy 3 months ago.
50740b.png (7.9 KB) - added by ramiy 3 months ago.
50740c.png (7.2 KB) - added by ramiy 3 months ago.
50740d.png (8.4 KB) - added by ramiy 3 months ago.
50740.patch (1009 bytes) - added by ramiy 3 months ago.
50740.1.diff (1020 bytes) - added by audrasjb 3 months ago.
New patch, generated against trunk/wordpress-develop and not the standalone installation

Download all attachments as: .zip

Change History (12)

@ramiy
3 months ago

@ramiy
3 months ago

@ramiy
3 months ago

@ramiy
3 months ago

@ramiy
3 months ago

#1 @ramiy
3 months ago

  • Keywords has-screenshots has-patch added

#2 @ramiy
3 months ago

  • Summary changed from i18n: Merge similar translation strings in core post api to i18n: Merge similar translation strings in privacy request statuses

@audrasjb
3 months ago

New patch, generated against trunk/wordpress-develop and not the standalone installation

#3 @audrasjb
3 months ago

  • Owner changed from whyisjake to audrasjb
  • Status changed from assigned to accepted

#4 @audrasjb
3 months ago

  • Owner changed from audrasjb to whyisjake
  • Status changed from accepted to assigned

#5 @SergeyBiryukov
3 months ago

  • Milestone changed from Awaiting Review to 5.5

#6 @SergeyBiryukov
3 months ago

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

In 48578:

I18N: Add context to privacy request status strings.

These strings already have a context in create_initial_post_types(), and should use the same context in _wp_privacy_statuses().

Props ramiy, audrasjb.
Fixes #50740.

Note: See TracTickets for help on using tickets.