Ticket #3244 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

tiny i18n fix

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

Description

comments_number function is not outputting internationalized strings.

Attachments

comment-i18n.diff (214 bytes) - added by mamay on 10/14/06 06:28:27.
comment_number_i18n.diff (0.9 kB) - added by markjaquith on 10/14/06 11:47:56.
Patch for trunk
comment_number_i18n_2.diff (0.9 kB) - added by markjaquith on 10/16/06 04:33:43.
Updated, with Masquerade's help
comment_number_i18n_3.diff (0.9 kB) - added by markjaquith on 10/16/06 04:37:54.
third try... more meaningful variable name, removed $comment as global
comment_number_i18n_4.diff (1.2 kB) - added by markjaquith on 10/16/06 05:00:24.
Only pass default strings through gettext

Change History

10/14/06 06:28:27 changed by mamay

  • attachment comment-i18n.diff added.

10/14/06 10:14:28 changed by Viper007Bond

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

10/14/06 11:47:06 changed by markjaquith

  • 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).

10/14/06 11:47:56 changed by markjaquith

  • attachment comment_number_i18n.diff added.

Patch for trunk

10/16/06 04:33:43 changed by markjaquith

  • attachment comment_number_i18n_2.diff added.

Updated, with Masquerade's help

10/16/06 04:37:54 changed by markjaquith

  • attachment comment_number_i18n_3.diff added.

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

10/16/06 04:43:09 changed by ryan

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

10/16/06 05:00:24 changed by markjaquith

  • attachment comment_number_i18n_4.diff added.

Only pass default strings through gettext

11/19/06 07:45:29 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

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