Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#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 Bas Peschier, 13 years ago

Component: Uncategorizedcontrib.humanize
Resolution: duplicate
Status: newclosed

Duplicate of #16562 which actually discovered the problem.

comment:2 by Dmitry Pisklov, 13 years ago

Resolution: duplicate
Status: closedreopened

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 Jannis Leidel, 13 years ago

Resolution: needsinfo
Status: reopenedclosed

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 anonymous, 13 years ago

Resolution: needsinfo
Status: closedreopened

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 anonymous, 13 years ago

Resolution: fixed
Status: reopenedclosed

oooops.
Just looked in SVN - looks like it was fixed at r16168.
I'm using older version.
Thanks jezdez for fixing - sorry for disturbing:)

comment:6 by Jacob, 13 years ago

milestone: 1.4

Milestone 1.4 deleted

Note: See TracTickets for help on using tickets.
Back to Top