Requires {% load i18n %}
Add {% load i18n %} near the top of any template that
uses {% blocktranslate %}. Without it Django does not
know the name and raises TemplateSyntaxError.
Translates a whole block, which is what you need the moment a variable or a plural is involved.
Template
{% load i18n %}
{% blocktranslate with name=user.first_name %}
Welcome back, {{ name }}.
{% endblocktranslate %}
Only simple variables may appear inside the block, which is why with exists — bind the expression first, then use the plain name. Add trimmed to keep the collected string free of the template's indentation.
