Setting Up Templates and Python Scripts for Translation
By Güngör Budak
- One minute read - 59 wordsTemplates need following template tag:
1{% raw %}{% load i18n %}{% endraw %}
Then, wrapping any text with
1{% raw %}{% trans "TEXT" %}{% endraw %}
will make it translatable via Rosetta Django application
In Python scripts, you need to import following library:
from django.utils.translation import ugettext_lazy as _
Then wrapping any text with
1_('TEXT')
will make it translatable.