WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 2 months ago

#41667 closed defect (bug) (fixed)

i18n: Use %s placeholders in rest api translation strings

Reported by: ramiy Owned by: SergeyBiryukov
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch
Focuses: rest-api Cc:

Description

This patch has several changes:

  1. It replaces the register_routes() method with a %s placeholder.
  2. It replaces the apostrophe around the %s placeholders with <code> tags.
  3. It adds translators comments to all the translation strings.

Attachments (2)

41667.png (37.4 KB) - added by ramiy 3 months ago.
41667.patch (7.4 KB) - added by ramiy 3 months ago.

Download all attachments as: .zip

Change History (12)

@ramiy
3 months ago

@ramiy
3 months ago

#1 @ramiy
3 months ago

The patch also adds a period at the end of the sentence and it has a small text change to match the other string.

Old translation strings:

  • The register_routes() method must be overridden
  • Method '%s' not implemented. Must be overridden in subclass.

New translation strings:

  • Method %s must be overridden.
  • Method %s not implemented. Must be overridden in subclass.

#3 @Soean
3 months ago

  • Keywords has-patch added

#4 @SergeyBiryukov
3 months ago

  • Milestone changed from Awaiting Review to 4.9
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#5 @ramiy
3 months ago

Clarification about the text changes - this patch replace 12 strings:

  • Method '%s' not implemented. Must be overridden in subclass.

With:

  • Method %s not implemented. Must be overridden in subclass.

And also, it replaces one string:

  • The register_routes() method must be overridden

With:

  • Method %s must be overridden.

#6 @SergeyBiryukov
2 months ago

I'd suggest only changing the register_routes() string and leaving the Method '%s' not implemented strings as is, I'm not sure HTML is allowed in all contexts there.

#7 @SergeyBiryukov
2 months ago

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

In 41587:

I18N: Replace method name in a translatable string in WP_REST_Controller::register_routes() with a placeholder.

Props ramiy.
Fixes #41667.

#8 @ramiy
2 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

In my patch I've also added translators comments to all the other translators strings using %s placeholder. We need this data for GlotPress.

#9 @SergeyBiryukov
2 months ago

Right, sorry, missed that.

#10 @SergeyBiryukov
2 months ago

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

In 41591:

I18N: Add translator comments for placeholders in WP_REST_Controller strings.

Props ramiy.
Fixes #41667.

Note: See TracTickets for help on using tickets.