---
title: '{% blocktranslate %}'
description: translates a block containing variables.
date: '2026-08-21'
categories:
  - Template Tag
  - Utility
canonical: https://coolify.djangotemplatetagsandfilters.com/tags/blocktranslate/
doc_link: >-
  https://docs.djangoproject.com/en/6.1/topics/i18n/translation/#std-templatetag-blocktranslate
---

# {% blocktranslate %}

translates a block containing variables.

## Documentation

Translates a whole block, which is what you need the moment a variable or a plural is involved.

### Template

```django
{% 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.
