Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#41643 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:

Attachments (2)

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

Download all attachments as: .zip

Change History (9)

@ramiy
8 years ago

@ramiy
8 years ago

#1 @ramiy
8 years ago

  • Keywords has-patch added

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

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

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

In that case, fine by me.

#7 @SergeyBiryukov
7 years ago

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

In 41588:

I18N: Replace code fragments in translatable strings for rest_trash_not_supported errors with a placeholder.

Props ramiy.
Fixes #41643.

Note: See TracTickets for help on using tickets.