WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#3677 closed enhancement (fixed)

i18n for number_format()

Reported by: markjaquith Owned by: rob1n
Milestone: 2.3 Priority: low
Severity: normal Version:
Component: I18N Keywords: has-patch i18n commit
Focuses: Cc:

Description

We're using number_format() in a few places, which converts to American style formatting for thousands grouping. We might consider making a __number_format() function that localizers can use to format numbers appropriately.

Attachments (3)

number-format-i18n.diff (1.7 KB) - added by nbachiyski 10 years ago.
number_format_i18n function
number-format-i18n-uses.diff (3.4 KB) - added by nbachiyski 10 years ago.
let's use this number_format_i18n
3677.diff (2.3 KB) - added by Sewar 10 years ago.
Moving the variables to $locale.php

Download all attachments as: .zip

Change History (12)

#1 @foolswisdom
10 years ago

  • Cc nbachiyski added

#2 @nbachiyski
10 years ago

  • Keywords has-patch i18n added

I named the function number_format_i18n after date_i18n.
There are two patches - the first is the function implementation. The second one just substitutes number_format with number_format_i18n wherever I found occurrences. I have skipped Akismet. It could fallback to number_format if the new function does not exists, but may be some other time :)

@nbachiyski
10 years ago

number_format_i18n function

@nbachiyski
10 years ago

let's use this number_format_i18n

#3 @foolswisdom
10 years ago

  • Milestone changed from 2.2 to 2.3

#4 @rob1n
10 years ago

  • Owner changed from ryan to rob1n

I like this. +1.

#5 @rob1n
10 years ago

  • Component changed from General to i18n
  • Keywords commit added

#6 @rob1n
10 years ago

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

(In [5308]) Allow number_format to be internationalized. Props nbachiyski. fixes #3677

#7 @Sewar
10 years ago

  • Cc Sewar added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Let's move these variables from gettext system to $locale.php. It is created for such things.

@Sewar
10 years ago

Moving the variables to $locale.php

#8 @nbachiyski
10 years ago

If I must be honest, I would like to keep at most information as we can in gettext. Otherwise many translators may no even look at the possibilities that $locale.php gives and just translate the po file.

#9 @rob1n
10 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.