5👍
✅
Probably, you forgot to load translation tags. Add following line at the top of your template:
{% load i18n %}
After you fix that, note that for a blocktrans
tag after count
a variable, whose value will serve for plural detection, should be specified, so you probably need something like
{% blocktrans count count=forloop.counter %}
👤alko
6👍
Here is the working code, thanks to alko:
{% load i18n %}
<!-- ... -->
{% if forloop.last %}
<h4>
{{ forloop.counter }}
{% blocktrans count count=forloop.counter %}
Valued Customer
{% plural %}
Valued Customers
{% endblocktrans %}
</h4>
{% endif %}
👤pete
- [Django]-How to iterate over several list at the same time?
- [Django]-Jenkins not failing on tests that fail in coverage
- [Django]-Django: ImportError: cannot import name 'GeoIP2'
- [Django]-Why django contains a lot of '__init__.py'?
- [Django]-Django ImageField not uploading the image
Source:stackexchange.com