Reputation: 640
Base template that I have:
{% load auth_extras %}
{% if request.user|has_group:"Administrator" %}
<li><a href="/admin/"> Admin Section </a></li>
{% endif %}
{% if request.user|has_group:"Moderator" %}
<li><a href="/admin/">Admin Section </a></li>
{% endif %}
How to add {% trans " " %} tag to "Admin Section" in this case ??? Adding it dirrectly is restricted because I have tag in tag which is not allowed. Or will be better to ask - how to be in this case ?
Upvotes: 0
Views: 271
Reputation:
can you use trans ... as
? more details trans-template-tag
{% trans "Admin Section" as adm_section %}
{% if request.user|has_group:"Moderator" %}
<li><a href="/admin/"> {{ adm_section }}</a></li>
{% endif %}
Upvotes: 2