WordPress.org

Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#3244 closed defect (bug) (fixed)

tiny i18n fix

Reported by: mamay Owned by: markjaquith
Milestone: 2.1 Priority: lowest
Severity: normal Version: 2.0.4
Component: General Keywords: has-patch
Focuses: Cc:

Description

comments_number function is not outputting internationalized strings.

Attachments (5)

comment-i18n.diff (214 bytes) - added by mamay 14 years ago.
comment_number_i18n.diff (921 bytes) - added by markjaquith 14 years ago.
Patch for trunk
comment_number_i18n_2.diff (893 bytes) - added by markjaquith 14 years ago.
Updated, with Masquerade's help
comment_number_i18n_3.diff (916 bytes) - added by markjaquith 14 years ago.
third try... more meaningful variable name, removed $comment as global
comment_number_i18n_4.diff (1.2 KB) - added by markjaquith 14 years ago.
Only pass default strings through gettext

Download all attachments as: .zip

Change History (9)

@mamay
14 years ago

#1 @Viper007Bond
14 years ago

I believe it is assumed that the inputted strings are already internationalized.

#2 @markjaquith
14 years ago

  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned

Hm, don't think so. And for more than one, we need to use __ngettext()

See patch. I also re-ordered the logic, removed the last test (after all, if a positive integer isn't greater than one, and isn't zero, it MUST be one), and passed the number of comments to the filter at the end, to make it easier for plugin authors to use the filter (no need to preg_match() the number).

@markjaquith
14 years ago

Patch for trunk

@markjaquith
14 years ago

Updated, with Masquerade's help

@markjaquith
14 years ago

third try... more meaningful variable name, removed $comment as global

#3 @ryan
14 years ago

Passing variable strings to ngettext() is sketchy. The variable names can end up in the catalog.

@markjaquith
14 years ago

Only pass default strings through gettext

#4 @ryan
14 years ago

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

(In [4494]) i18n fix for comments_number(). Props Mark Jaquith. fixes #3244

Note: See TracTickets for help on using tickets.