[Django] #24913: localize filter tag not work for thousand separator then USE_L10N is False

42 views
Skip to first unread message

Django

unread,
Jun 3, 2015, 10:06:54 PM6/3/15
to django-...@googlegroups.com
#24913: localize filter tag not work for thousand separator then USE_L10N is False
--------------------------------------+----------------------
Reporter: Andertaker | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 1.7
Severity: Normal | Keywords: localize
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+----------------------
in settings.py
'''USE_L10N = False
USE_THOUSAND_SEPARATOR = True'''

it template
{% localize on %}
{{ object.price }}
{% endlocalize %}
or
{{ object.price|localize }}

but there is no affect

I think in util.formats.number_format function should be something like
this
if use_l10n:
force_grouping = True

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

Django

unread,
Jun 4, 2015, 6:35:28 AM6/4/15
to django-...@googlegroups.com
#24913: localize filter tag not work for thousand separator then USE_L10N is False
--------------------------------------+------------------------------------

Reporter: Andertaker | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 1.7
Severity: Normal | Resolution:
Keywords: localize | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0


Comment:

Been able to reproduce with the latest Django 1.9.dev20150604012012.
[https://docs.djangoproject.com/en/1.8/topics/i18n/formatting/#localize
The documentation] isn't very specific on this topic, even though it would
feel natural that by switching on localization, the setting of
`USE_THOUSAND_SEPARATOR` should be respected.

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

Django

unread,
Jun 4, 2015, 6:39:05 AM6/4/15
to django-...@googlegroups.com
#24913: localize filter tag not work for thousand separator then USE_L10N is False
-------------------------------------+-------------------------------------
Reporter: Andertaker | Owner: ana-
| balica
Type: Bug | Status: assigned
Component: | Version: 1.7
Internationalization |

Severity: Normal | Resolution:
Keywords: localize | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

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

* status: new => assigned
* owner: nobody => ana-balica
* needs_tests: 0 => 1


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

Django

unread,
Jun 4, 2015, 7:04:47 AM6/4/15
to django-...@googlegroups.com
#24913: Localize filter tag doesn't work for thousand separator then USE_L10N is
False

-------------------------------------+-------------------------------------
Reporter: Andertaker | Owner: ana-
| balica
Type: Bug | Status: assigned
Component: | Version: 1.7
Internationalization |
Severity: Normal | Resolution:
Keywords: localize | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by ana-balica:

Old description:

> in settings.py
> '''USE_L10N = False
> USE_THOUSAND_SEPARATOR = True'''
>
> it template
> {% localize on %}
> {{ object.price }}
> {% endlocalize %}
> or
> {{ object.price|localize }}
>
> but there is no affect
>
> I think in util.formats.number_format function should be something like
> this
> if use_l10n:
> force_grouping = True

New description:

In settings.py set


'''USE_L10N = False
USE_THOUSAND_SEPARATOR = True'''

In the template do this:
{{{


{% localize on %}
{{ object.price }}
{% endlocalize %}
}}}
or
{{{
{{ object.price|localize }}
}}}

Switching on the localization doesn't trigger the `USE_THOUSAND_SEPARATOR`
setting in case it's set to True.

I think in util.formats.number_format function should be something like
this
{{{
if use_l10n:
force_grouping = True
}}}

--

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

Django

unread,
Jun 4, 2015, 7:26:24 AM6/4/15
to django-...@googlegroups.com
#24913: Localize filter tag doesn't work for thousand separator then USE_L10N is
False

-------------------------------------+-------------------------------------
Reporter: Andertaker | Owner: ana-
| balica
Type: Bug | Status: assigned
Component: | Version: 1.7
Internationalization |
Severity: Normal | Resolution:
Keywords: localize | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

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

Comment (by timgraham):

Elsewhere [https://docs.djangoproject.com/en/stable/ref/settings/#use-
thousand-separator docs say], "When USE_L10N is set to True and if this is
also set to True, Django will use the values of THOUSAND_SEPARATOR and
NUMBER_GROUPING to format numbers." so I think this might be invalid.

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

Django

unread,
Jun 4, 2015, 7:51:52 AM6/4/15
to django-...@googlegroups.com
#24913: Localize filter tag doesn't work for thousand separator then USE_L10N is
False

-------------------------------------+-------------------------------------
Reporter: Andertaker | Owner: ana-
| balica
Type: Bug | Status: closed
Component: | Version: 1.7
Internationalization |
Severity: Normal | Resolution: duplicate

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

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

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


Comment:

This is a duplicate of #21544 which I think is a valid issue.

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

Reply all
Reply to author
Forward
0 new messages