2π
β
Itβs not translated because {{house_type}}
will have the value of house_post.house_type.name
.
The blocktrans actually does nothing in your code. You would need it if you want to add a translatable text to the sentence. Ex:
{% blocktrans with house_type=house_post.house_type.name trimmed %}
{{house_type}} Translate this part
{% endblocktrans %}
If you want to have a translated variable, you have to pass the translations to house_post.house_type.name
.
π€ferrangb
0π
The content of your blocktrans is most likely the content of {{house_type}}
. Not sure where it comes from, but this is where you have to translate it. Donβt forget to insert something like
from django.utils.translation import ugettext_lazy as _
to header of your py-files.
π€frlan
- [Answered ]-How to map a value to another in Django Rest
- [Answered ]-Django Rest Framework adding 2 numbers
Source:stackexchange.com