Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#29220 closed defect (bug) (fixed)

Plugin Install: "x stars" is not translatable

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

Description

Attachments (2)

29220.diff​ (936 bytes ) - added by jesin 12 years ago.
29220.2.diff​ (1.4 KB ) - added by jesin 12 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
12 years ago

#1 follow-up: @jesin
12 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
12 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
12 years ago

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

#3 @jesin
12 years ago

I think the alignment is perfect now.

#4 @ocean90
12 years ago

  • Owner set to ocean90
  • Resolution → fixed
  • Status new → closed

In 29510:

Plugin details: Use translation functions.

props jesin.
fixes #29220.

#5 @danielbachhuber
12 years ago

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

#6 @SergeyBiryukov
12 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 12 years ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.