Opened 6 years ago
Closed 6 years ago
#3677 closed enhancement (fixed)
i18n for number_format()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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 (3)
Change History (12)
comment:1
foolswisdom — 6 years ago
- Cc nbachiyski added
comment:2
nbachiyski — 6 years ago
- Keywords has-patch i18n added
comment:3
foolswisdom — 6 years ago
- Milestone changed from 2.2 to 2.3
- Resolution set to fixed
- Status changed from new to closed
- 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.
comment:8
nbachiyski — 6 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.
Note: See
TracTickets for help on using
tickets.

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 :)