19👍
✅
You forgot the count variable as variable_name
in the blocktrans tag
The value of that variable will be used to detect if it’s plural or not.
{% blocktrans count variable as variable_name %}
time
{% plural %}
{{ variable_name }} times
{% endblocktrans %}
👤naw
-4👍
You can use:
{% blocktrans with video.views.count|pluralize as foo and video.views.count as views %}
The video has been viewed <span>{{ views }}</span> time{{ foo }}
{% endblocktrans %}
- Django + Emacs (as TextMate replacement)
- How to filter objects by ignoring upper and lower case letter django
- Saving objects and their related objects at the same time in Django
- Jinja2 templates a superset of Django templates?
Source:stackexchange.com