4👍
✅
Django is just Python so you can use the Python gettext bindings directly if you need to, I don’t see any reason you couldn’t write a {% gender_trans [gender] %} tag.
10👍
The way that I’ve solved this is:
{% if profile.male %}
{% blocktrans with profile.name as male %}Welcome, {{ male }}{% endblocktrans %}
{% else %}
{% blocktrans with profile.name as female %}Welcome, {{ female }}{% endblocktrans %}
{% endif %}
- Django generate csv file on view and download
- Create a separate app for my REST API or place it inside my working app?
2👍
While waiting for contexts to be supported, an easy alternative would be to slightly change the Spanish sentence and use a greeting that does not vary according to a person’s gender. For example, you could use “hola”, or some other equivalent term.
- Django-Rest-Framework: Paginate nested object
- Is it possible to make a mobile app in Django?
- Django's annotate Count with division returns integer instead of float
Source:stackexchange.com