[Answered ]-{% block %} in {% blocktrans %}

2👍

The docs of blocktrans state the following:

Other block tags (for example {% for %} or {% if %}) are not allowed inside a blocktrans tag.

block is another block tag, so it is not supported inside blocktrans either. The only thing allowed inside blocktrans is a direct variable substitution (without any filters, or attribute / method resolution using .).

In other words, what you’re asking for is simply not possible with blocktrans. You’ll have to reorganize your templates accordingly.

Leave a comment