Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#15376 closed (duplicate)

translation in templates does not allow for a context variable

Reported by: wildfire@… Owned by: nobody
Component: Internationalization Version: 1.3-beta
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


As per, one of the newer features of the i18n framework allows for a context to be associated with each translatable string.

This works great, if all your strings are in your views.

However it is not so useful if your strings are in your templates and you also want to present the same context to translators (ideally, a single .po file with all translatable strings and contexts).

What would be nice is an extension to the 'trans' tag so that if two values were given to it, i.e.

{% trans "Month name" "May" %}

The contextual portion (the first string) in this case is output to the .po file

This may require some extra careful jiggery-pokery if this option is taken since {% trans "string" noop %} is also possible.

Change History (3)

comment:1 Changed 7 years ago by anonymous

milestone: 1.3

comment:2 Changed 7 years ago by Jannis Leidel

Resolution: duplicate
Status: newclosed

Duplicate of #14806.

comment:3 Changed 7 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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