WordPress.org

Make WordPress Core

Opened 5 weeks ago

Last modified 4 weeks ago

#41643 reviewing defect (bug)

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:

Attachments (2)

force-true.png (69.9 KB) - added by ramiy 5 weeks ago.
41643.patch (4.2 KB) - added by ramiy 5 weeks ago.

Download all attachments as: .zip

Change History (8)

@ramiy
5 weeks ago

@ramiy
5 weeks ago

#1 @ramiy
5 weeks ago

  • Keywords has-patch added

#2 @ramiy
5 weeks ago

The translators should not have access to code like force=true, they can accidentally change some characters.

When using code in translation strings we should always use %s placeholders.

#3 @SergeyBiryukov
5 weeks ago

  • Component changed from Text Changes to I18N
  • Focuses rest-api added
  • Milestone changed from Awaiting Review to 4.9
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#4 @johnbillion
5 weeks ago

This is good, but I think the translator comment can be improved to better explain what force=true is.

#5 @ramiy
4 weeks ago

@johnbillion This is the common practice. We usually use the file name, function name or code example in the translator comments. But if you have a better explanation, I'll update the patch.

#6 @johnbillion
4 weeks ago

In that case, fine by me.

Note: See TracTickets for help on using tickets.