[Django] #25920: django.contrib.humanize filters are not well localized for en_IN

23 views
Skip to first unread message

Django

unread,
Dec 11, 2015, 8:45:51 AM12/11/15
to django-...@googlegroups.com
#25920: django.contrib.humanize filters are not well localized for en_IN
----------------------------------+--------------------
Reporter: dbinoj | Owner: nobody
Type: Bug | Status: new
Component: contrib.humanize | Version: 1.9
Severity: Normal | Keywords: en-IN
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------
When using 'en-IN' as locale (listed as valid in
http://www.i18nguy.com/unicode/language-identifiers.html) 100000.00 should
look like 1,00,000.00 after using intcomma. Instead 100,000.00 is
displayed.

Works as expected in locale package as below (with en_IN installed, of
course):
{{{
In [1]: import locale

In [2]: locale.setlocale(locale.LC_ALL, 'en_IN')
Out[2]: 'en_IN'

In [3]: locale.format("%.2f", 100000.00, grouping=True)
Out[3]: '1,00,000.00'
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25920>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 11, 2015, 10:07:17 AM12/11/15
to django-...@googlegroups.com
#25920: django.contrib.humanize filters are not well localized for en_IN
----------------------------------+--------------------------------------
Reporter: dbinoj | Owner: nobody
Type: Bug | Status: closed
Component: contrib.humanize | Version: 1.9
Severity: Normal | Resolution: invalid

Keywords: en-IN | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by timgraham):

* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0


Comment:

I think the solution here is to add formats for the `en_IN` locale (like
ff2e0896a3f7b566c8a0802b2191d30c6070c8f6, for example). Please send a pull
request if you can do that. I don't think there's much value in leaving an
open ticket for each locale that we're missing. Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:1>

Django

unread,
Dec 11, 2015, 10:29:34 AM12/11/15
to django-...@googlegroups.com
#25920: django.contrib.humanize filters are not well localized for en_IN
----------------------------------+--------------------------------------

Reporter: dbinoj | Owner: nobody
Type: Bug | Status: new
Component: contrib.humanize | Version: 1.9
Severity: Normal | Resolution:

Keywords: en-IN | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by dbinoj):

* status: closed => new
* resolution: invalid =>


Comment:

There is a complication in adding en_IN. Number grouping in en_IN is not
grouped on 'n' number of digits. First 3 (ones, tens and hundreds) are
grouped as a single group and the remaining digits are grouped as 2 digits
per group. This can be achieved with a NUMBER_GROUPING setting. So I don't
think this can be fixed by adding a locale.

--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:2>

Django

unread,
Dec 11, 2015, 2:09:50 PM12/11/15
to django-...@googlegroups.com
#25920: django.contrib.humanize filters are not well localized for en_IN
----------------------------------+------------------------------------
Reporter: dbinoj | Owner: nobody
Type: New feature | Status: new
Component: contrib.humanize | Version: 1.9
Severity: Normal | Resolution:
Keywords: en-IN | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by claudep):

* type: Bug => New feature
* stage: Unreviewed => Accepted


Comment:

Confirmed, Django doesn't support this sort of grouping yet.

--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:3>

Django

unread,
Dec 11, 2015, 2:22:45 PM12/11/15
to django-...@googlegroups.com
#25920: Add number formatting support for locales that use non-uniform digit
grouping (e.g. India)
--------------------------------------+------------------------------------
Reporter: dbinoj | Owner: nobody

Type: New feature | Status: new
Component: Internationalization | Version: 1.9

Severity: Normal | Resolution:
Keywords: en-IN | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* component: contrib.humanize => Internationalization


--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:4>

Django

unread,
Jun 2, 2016, 1:37:28 PM6/2/16
to django-...@googlegroups.com
#25920: Add number formatting support for locales that use non-uniform digit
grouping (e.g. India)
--------------------------------------+------------------------------------
Reporter: dbinoj | Owner: jasisz
Type: New feature | Status: assigned

Component: Internationalization | Version: 1.9
Severity: Normal | Resolution:
Keywords: en-IN | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by jasisz):

* owner: nobody => jasisz
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:5>

Django

unread,
Jun 2, 2016, 3:54:33 PM6/2/16
to django-...@googlegroups.com
#25920: Add number formatting support for locales that use non-uniform digit
grouping (e.g. India)
--------------------------------------+------------------------------------
Reporter: dbinoj | Owner: jasisz
Type: New feature | Status: assigned
Component: Internationalization | Version: 1.9
Severity: Normal | Resolution:
Keywords: en-IN | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by jasisz):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:6>

Django

unread,
Jun 2, 2016, 3:59:05 PM6/2/16
to django-...@googlegroups.com
#25920: Add number formatting support for locales that use non-uniform digit
grouping (e.g. India)
--------------------------------------+------------------------------------
Reporter: dbinoj | Owner: jasisz
Type: New feature | Status: assigned
Component: Internationalization | Version: 1.9
Severity: Normal | Resolution:
Keywords: en-IN | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by jasisz):

PR for this: https://github.com/django/django/pull/6693
It basically adds possibility to use more robust NUMBER_GROUPING using
style similar to POSIX locale grouping option.

--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:7>

Django

unread,
Jun 3, 2016, 1:32:30 PM6/3/16
to django-...@googlegroups.com
#25920: Add number formatting support for locales that use non-uniform digit
grouping (e.g. India)
-------------------------------------+-------------------------------------

Reporter: dbinoj | Owner: jasisz
Type: New feature | Status: assigned
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution:
Keywords: en-IN | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by phildini):

* stage: Accepted => Ready for checkin


Comment:

I looked at the pull request, and think it looks RTC for the following
reasons:

- Has tests
- Test suite passes
- Old functionality from previous tests remains unchanged.

--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:8>

Django

unread,
Jun 3, 2016, 3:57:49 PM6/3/16
to django-...@googlegroups.com
#25920: Add number formatting support for locales that use non-uniform digit
grouping (e.g. India)
--------------------------------------+------------------------------------

Reporter: dbinoj | Owner: jasisz
Type: New feature | Status: assigned
Component: Internationalization | Version: 1.9
Severity: Normal | Resolution:
Keywords: en-IN | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted


Comment:

A bit of documentation is missing as noted on the PR.

--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:9>

Django

unread,
Jun 3, 2016, 10:17:41 PM6/3/16
to django-...@googlegroups.com
#25920: Add number formatting support for locales that use non-uniform digit
grouping (e.g. India)
--------------------------------------+------------------------------------
Reporter: dbinoj | Owner: jasisz
Type: New feature | Status: assigned
Component: Internationalization | Version: 1.9
Severity: Normal | Resolution:
Keywords: en-IN | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:10>

Django

unread,
Jun 22, 2016, 5:32:31 PM6/22/16
to django-...@googlegroups.com
#25920: Add number formatting support for locales that use non-uniform digit
grouping (e.g. India)
--------------------------------------+------------------------------------
Reporter: dbinoj | Owner: jasisz
Type: New feature | Status: closed
Component: Internationalization | Version: 1.9
Severity: Normal | Resolution: fixed

Keywords: en-IN | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b5a1c3a6f50362b57603e1833e44bff5628dde3c" b5a1c3a]:
{{{
#!CommitTicketReference repository=""
revision="b5a1c3a6f50362b57603e1833e44bff5628dde3c"
Fixed #25920 -- Added support for non-uniform NUMBER_GROUPING.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25920#comment:11>

Reply all
Reply to author
Forward
0 new messages