Opened 13 years ago

Closed 13 years ago

#16717 closed New feature (fixed)

Add optional [as VARNAME] to trans template tag

Reported by: Jannis Leidel Owned by: nobody
Component: Internationalization Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Part of this year's SoC about form rendering (https://github.com/gregmuellegger/django/tree/soc2011/form-rendering) had to deal with dynamically changing the label of a form field in the template. For that purpose it's required to easily set a context variable with a translated string. E.g.:

{% trans "Your full name" as full_name %}
...
{% formfield form.full_name with label=full_name %}
...

Change History (3)

comment:1 by Jannis Leidel, 13 years ago

Summary: Added optional [as VARNAME] to trans template tagAdd optional [as VARNAME] to trans template tag

comment:2 by Aymeric Augustin, 13 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Jannis Leidel, 13 years ago

Resolution: fixed
Status: newclosed

In [16712]:

Fixed #16717 -- Added ability to store result of trans template tag in context variable.

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