Opened 5 years ago

Closed 5 years ago

Last modified 5 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


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 Changed 5 years ago by Bas Peschier

Component: Uncategorizedcontrib.humanize
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: duplicate
Status: newclosed

Duplicate of #16562 which actually discovered the problem.

comment:2 Changed 5 years ago by Dmitry Pisklov

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 Changed 5 years ago by Jannis Leidel

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 Changed 5 years ago by anonymous

Resolution: needsinfo
Status: closedreopened

Well, here's an example:
I have the following code in template:


If the object price is 2500, the output is:


disregarding of locale which is RU in my case.

The problem is, in number of countries ( 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 Changed 5 years ago by anonymous

Resolution: fixed
Status: reopenedclosed

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 Changed 5 years ago by Jacob

milestone: 1.4

Milestone 1.4 deleted

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