Opened 4 years ago

Closed 4 years ago

#17326 closed Bug (invalid)

{% trans %} in inline javascript code

Reported by: Natim Owned by: nobody
Component: Template system Version: 1.3
Severity: Normal Keywords: translation
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


We've got this issue on django-filebrowser but I think it is related to a django template translation problem.

How to escape {% trans %} for js ? Maybe we need a {% transjs %} tag ?

Change History (1)

comment:1 Changed 4 years ago by bpeschier

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

If you need specific manipulation of translation results, you can use the new {% trans "my string" as my_variable %} feature as described at

After the translation is available in the context, you can escape it.

Note: See TracTickets for help on using tickets.
Back to Top