#30086: The numberformat template filter does not respect local localization
settings
-------------------------------------------+------------------------
Reporter: Meiyer | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
Specifically, when the filter is used within the `{% localize [on|off] %}`
block with the localization setting opposed to the value of `USE_L10N`
('on' when `USE_L10N = False` or 'off' when `USE_L10N = True`), the
localization setting has not effect.
This is due to the use of `formats.number_format()` without its `use_l10n`
parameter, by the `numberformat` template filter (e.g.
https://github.com/django/django/blob/master/django/template/defaultfilters.py#L144,
https://github.com/django/django/blob/master/django/template/defaultfilters.py#L163).
The value of the `use_l10n` parameter shall be taken out of the template
rendering context. But I do not see any easy solution to this, as filters
do not take context...
--
Ticket URL: <https://code.djangoproject.com/ticket/30086>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.e504de06d19d7bf8aabfa2df39d62a1c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.