[Answer]-Django – {% blocktrans %} {{rendered_variable}} {% endblocktrans %}

1👍

blocktrans is for translating the text around a variable, but it won’t translate the variable itself.

This answer can be helpful for you. More info in docs.

👤cor

0👍

I just did the translation in models.py like this:

_('Capricorn')
_('Aquarius') 
_('Pisces') 
_('Aries') 
_('Taurus') 
_('Gemini') 
_('Cancer')
_('Leo') 
_('Virgo') 
_('Libra') 
_('Scorpio') 
_('Sagittarius')

and in template just

{{sign}}

and it is working.

Leave a comment