Changes between Initial Version and Version 1 of Ticket #30086
- Timestamp:
- Jan 9, 2019, 10:10:54 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30086
- Property Component Template system → Documentation
- Property Triage Stage Unreviewed → Accepted
- Property Summary The numberformat template filter does not respect local localization settings → Document how floatformat template filter interacts with the localize template tag
- Property Type Bug → Cleanup/optimization
-
Ticket #30086 – Description
initial v1 1 1 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. 2 2 3 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...3 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/c2c85663e2dd06c9ed9c9ec2d02202d6d668d7f0/django/template/defaultfilters.py#L144, https://github.com/django/django/blob/c2c85663e2dd06c9ed9c9ec2d02202d6d668d7f0/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...