Opened 7 years ago
Last modified 7 years ago
#28711 closed Bug
unordered_list template filter does not work with lazy translations — at Version 1
Reported by: | Jonas Haag | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I would expect that the following assertion holds true:
from django.utils.translation import ugettext_lazy as _ from django.template.defaultfilters import unordered_list assert unordered_list(['', _('lazy')]) == unordered_list(['', 'lazy']))
I.e., unordered_list
handles lazy translations as if they were strings.
This used to work in Django < 1.8, more specifically before the patch to this ticket: https://code.djangoproject.com/ticket/23260
This bug exists in all versions 1.8–master.
Pull request follows.
Note:
See TracTickets
for help on using tickets.