Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#16558 closed Bug (fixed)

django.contrib.humanize filters are not well localized

Reported by: blackraven Owned by: blackraven
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 Changed 4 years ago by bpeschier

  • Component changed from Uncategorized to contrib.humanize
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #16562 which actually discovered the problem.

comment:2 Changed 3 years ago by blackraven

  • Resolution duplicate deleted
  • Status changed from closed to 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 Changed 3 years ago by jezdez

  • Resolution set to needsinfo
  • Status changed from reopened to 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 Changed 3 years ago by anonymous

  • Resolution needsinfo deleted
  • Status changed from closed to 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 Changed 3 years ago by anonymous

  • Resolution set to fixed
  • Status changed from reopened to 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:)

comment:6 Changed 3 years ago by jacob

  • milestone 1.4 deleted

Milestone 1.4 deleted

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