Plural blocktrans problem with Django
Posted
by jorde
on Stack Overflow
See other posts from Stack Overflow
or by jorde
Published on 2010-03-27T17:15:59Z
Indexed on
2010/03/27
17:23 UTC
Read the original article
Hit count: 218
I'm trying to translate a small block of text using Django's build in i18n. I don't know why but the following won't show up in different language:
{% if store.rating_count %}
{% blocktrans with store.rating_count as count %}
{{ count }} review
{% plural %}
{{ count }} reviews
{% endblocktrans %}
{% else %}
{% trans "No reviews" %}
{% endif %}
And a snipplet from my django.po (created with makemessages):
#: templates/reviews/category.html:65
#, python-format
msgid "%(count)s review"
msgid_plural "%(count)s reviews"
msgstr[0] "%(count)s arvostelu"
msgstr[1] "%(count)s arvostelua"
Other strings translate fine from the same template. I have rerun compilemessages few times.
© Stack Overflow or respective owner