Ticket #3677 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

i18n for number_format()

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

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

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

Change History

  • Cc nbachiyski added
  • 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 :)

number_format_i18n function

let's use this number_format_i18n

  • Milestone changed from 2.2 to 2.3
  • Owner changed from ryan to rob1n

I like this. +1.

  • Keywords commit added
  • Component changed from General to i18n
  • Status changed from new to closed
  • Resolution set to fixed

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

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

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

Sewar5 years ago

Moving the variables to $locale.php

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.

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