[Django]-Django trans and url tags

54👍

Use {% blocktrans %}. The Django translation docs include this example:

{% url path.to.view arg arg2 as the_url %}
{% blocktrans %}
This is a URL: {{ the_url }}
{% endblocktrans %}

1👍

This works for me:

{% url "app-name:name-of-view" as the_url %}
{% blocktrans %}
This is a URL: {{ the_url }}
{% endblocktrans %}
👤Ming

Leave a comment