{% blocktranslate %} Tag

translates a block containing variables.

Utility Most Useful As Markdown

Argument(s)
[with …] [count …] [trimmed]
Closing tag
Required — {% endblocktranslate %}
Requires
{% load i18n %}

Documentation

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.

More Utility Tags

All Utility Tags


Did we get something wrong? Is there a use case for the blocktranslate tag that we should add? Please let us know.

Send Feedback

Official Documentation
This page last updated on August 20, 2026