#16558 closed Bug (fixed)
django.contrib.humanize filters are not well localized
Reported by: | Dmitry Pisklov | Owned by: | Dmitry Pisklov |
---|---|---|---|
Component: | contrib.humanize | Version: | 1.3 |
Severity: | Normal | Keywords: | russian, humanize |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In some countries (namely, Russia), "decimal point" is actually comma, and thousands separator is space (as comma used as decimal part separator!). This needs to be fixed in humanize filters, as they are useless in ru locale right now.
Change History (6)
comment:1 by , 13 years ago
Component: | Uncategorized → contrib.humanize |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
comment:2 by , 13 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
Not a duplicate of #16562 - it's completely different bug referring to USE_THOUSANDS_SEPARATOR, and is has nothing to do with localization of separator character.
comment:3 by , 13 years ago
Resolution: | → needsinfo |
---|---|
Status: | reopened → closed |
I'm not sure what this ticket is reporting, to be honest, except that something "is not well localized". Feel free to re-open if you have a clear explanation of what you expected you find, but got instead. Any detail would be much appreciated.
comment:4 by , 13 years ago
Resolution: | needsinfo |
---|---|
Status: | closed → reopened |
Well, here's an example:
I have the following code in template:
{obj.price|intcomma}
If the object price is 2500, the output is:
2,500
disregarding of locale which is RU in my case.
The problem is, in number of countries (http://en.wikipedia.org/wiki/Decimal_mark#Countries_using_Arabic_numerals_with_decimal_comma) comma is decimal separator. So the output above is read as 2.500 ( two and five hundred thousandths ).
Instead, the decimal separator should be chosen according to locale, and in my case it should be just space char, so that my number will look like:
2 500
and any decimal number would look like:
1 234.56
Hope that makes things clear.
comment:5 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
oooops.
Just looked in SVN - looks like it was fixed at r16168.
I'm using older version.
Thanks jezdez for fixing - sorry for disturbing:)
Duplicate of #16562 which actually discovered the problem.