I've got a Django app with the following model:
from django.utils.translation import ugettext_lazy as _
class Student(models.Model):
# a bunch of fields
class Meta(object):
verbose_name = _('student')
verbose_name_plural = _('students')
The admin site is used in Finnish. The problem is the plural form: translated as-is without context, "students" translates to "opiskelijat". This is the correct translation for the front page and app index views, as well as the bread crumb navigation, and generally when no explicit number of students is reported.
However, in the change list view, for the count of students in the pagination area, it should pluralize to "opiskelijaa".
In summary:
- students = opiskelijat (e.g. these students = nämä opiskelijat)
- 0 students = 0 opiskelijaa
- 1 student = 1 opiskelija
- 2+ students = 2+ opiskelijaa
I've read the docs on the various *gettext facilities available in django.utils.translation
, but I'm not seeing a way to achieve this particular setup, where a nonexistent count causes the word to be translated differently than when the count exists. Is it possible?