Güngör Budak's Blog

Bioinformatics, web programming, coding in general

Setting Up Templates and Python Scripts for Translation

Share Tweet

Templates need following template tag:

{% load i18n %}

Then, wrapping any text with

{% trans "TEXT" %}

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

_('TEXT')

will make it translatable.

Share Tweet


Questions?

Please start a discussion down below or send me an email!