Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#29220 closed defect (bug) (fixed)

Plugin Install: "x stars" is not translatable

Reported by: ocean90's profile ocean90 Owned by: ocean90's profile ocean90
Milestone: 4.0 Priority: normal
Severity: trivial Version: 4.0
Component: Plugins Keywords: good-first-bug
Focuses: administration Cc:

Attachments (2)

29220.diff (936 bytes) - added by jesin 10 years ago.
29220.2.diff (1.4 KB) - added by jesin 10 years ago.
"x stars" translatable, min-width for .counter-label and $ratecount uses number_format_i18n()

Download all attachments as: .zip

Change History (8)

@jesin
10 years ago

#1 follow-up: @jesin
10 years ago

Patch 29220.diff uses _n() which prints 1 star instead of 1 stars as it appears in WP.org. Should I use __() instead?

#2 in reply to: ↑ 1 @ocean90
10 years ago

Replying to jesin:
Haven't thought about using _n() here, but that's the correct one in this case. There is only one small visual issue now, see https://cloudup.com/cMOS9_EGsqH. Seems like we have to use some sort of min-width here.

And while we are here, $ratecount should use number_format_i18n().

@jesin
10 years ago

"x stars" translatable, min-width for .counter-label and $ratecount uses number_format_i18n()

#3 @jesin
10 years ago

I think the alignment is perfect now.

#4 @ocean90
10 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 29510:

Plugin details: Use translation functions.

props jesin.
fixes #29220.

#5 @danielbachhuber
10 years ago

Does printf( _n( '%d star', '%d stars', $key ), $key ); need to be escaped?

#6 @SergeyBiryukov
10 years ago

  • Keywords needs-patch removed

Translated strings are considered safe, we generally only escape them when used in attributes.

$key comes directly from the API, so [29510] looks good to me as is.

Last edited 10 years ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.