I have a template in which you can pass a text variable. I want to include this template in another, but with the translation of the text as a variable. How can you achieve this?
I would like something like this:
{% include "a_dir/stuff.html" with text={% trans "Load more promotions" %} %}
I find it difficult to write my own template tag that will execute the ugettext , but then when creating the .po file, the text variable will not be taken automatically.
I do not want to do this work in view , since all our translations take place in templates.
source share