Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#41667 closed defect (bug) (fixed)

i18n: Use %s placeholders in rest api translation strings

Reported by: ramiy's profile ramiy Owned by: sergeybiryukov's profile 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 7 years ago.
41667.patch (7.4 KB) - added by ramiy 7 years ago.

Download all attachments as: .zip

Change History (12)

@ramiy
7 years ago

@ramiy
7 years ago

#1 @ramiy
7 years 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
7 years ago

  • Keywords has-patch added

#4 @SergeyBiryukov
7 years ago

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

#5 @ramiy
7 years 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
7 years 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
7 years 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
7 years 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
7 years ago

Right, sorry, missed that.

#10 @SergeyBiryukov
7 years 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.