#19136 closed Bug (fixed)
String literals in i18n JavaScript code is unescaped breaking
Description ¶
The footer JavaScript functions pgettext and npgettext contain unescaped string literals that lead to broken code that doesn't actually enable the functions to work correctly.
Change History (9)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
See the attached tests, it seems to work, at least in Firefox. Now it may be that the unescaped delimiter is causing issues, further investigations needed.
comment:3 by , 12 years ago
Reading Jannis' report, I understand that \x04
must be escaped in the arguments of the pgettext
and npgettext
functions before building value
.
comment:5 by , 12 years ago
Owner: | changed from | to
---|
comment:6 by , 12 years ago
Owner: | changed from | to
---|
comment:7 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
The code I mean can be found here: https://github.com/django/django/blob/9d2e1f065ede189f65e79eb3cb33a33b460a4351/django/views/i18n.py#L101-115
\x04
is the magic delimiter in gettext to make contexts work, so this needs to be escaped properly.