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.
- [Answer]-Django – Call model's method on demand to filter and prefetch data from a reversed foreignkey
- [Answer]-Why is my middleware not setting request attributes on logout?
- [Answer]-Django ORM: All items not in table
- [Answer]-How detect role user in django template?
Source:stackexchange.com