2

I am pretty new to Django. I have the following code in the template:

 {% blocktrans count answers.paginator.count as
 counter %}One Answer:{% plural %}{{counter}} Answers:{% endblocktrans %}

And the following line in the django PO (generated)

#: forum/skins/default/templates/question.html:149
#, python-format
msgid "One Answer:"
msgid_plural "%(counter)s Answers:"
msgstr[0] "Один ответ:"
msgstr[1] "%(counter)s ответа/-ов:"

Now the singular translation is working, but the plural somehow is not... Any idea what is missing?

Not working means that the output is;

"Один ответ" if counter is 1

"5 Answers" in case the counter is 5

So the counter is working.

Thanks, Pleun

Pleun
  • 8,856
  • 2
  • 30
  • 50
  • 1
    Try changing `answers.paginator.count as counter` to `counter=answers.paginator.count` (as provided in docs) – ilvar May 08 '12 at 04:53
  • `count foo as bar` is old usage, try `bar=foo` as ilvar said, if you're using relative new version of Django (1.3+). Also, what does "not working" exactly mean? – okm May 08 '12 at 13:58
  • I updated "not working" in the question. @ilvar I installed a trunk version of Osqsa "as is" I have not done anything with the sources/templates themselves so I would like to keep it that way. In all other cases translation is doing fine but I will try it anyway – Pleun May 08 '12 at 14:33
  • In `settings_local` template OSQA has `DJANGO_VERSION = '1.1'`, so it can be easily non-fully-compatible with modern Django. Try using 1.3, maybe. – ilvar May 08 '12 at 15:57

0 Answers0