Requires {% load i18n %}
Add {% load i18n %} near the top of any template that
uses {% translate %}. Without it Django does not
know the name and raises TemplateSyntaxError.
Translates a string using the active language.
Template
{% load i18n %}
<h1>{% translate "Welcome back" %}</h1>
The literal is what gets collected by makemessages and what a translator sees, so keep it a plain sentence rather than something assembled from pieces. For anything containing a variable or needing a plural, use {% blocktranslate %}.
