Django translation of model plural when plural form equals singular form
django
Solution
Try:
from django.utils.translation import pgettext
class News(models.Model):
class Meta:
verbose_name = pgettext("news singular", "news")
verbose_name_plural = pgettext("news plural", "news")
Problem
How can you tell ugettext that the plural form is not the singular form even if they are equal in English? ``` class News(models.Model): class Meta: verbose_name = _('news') verbose_name_plural = _('news') ``` makemessages gives this: ``` #: models.py:134, models.:135 msgid "news" msgstr "noticia" ``` Spliting this definition breaks the compilation with "duplicate message definition..." Workarounds I found: - Add a space at the end of the plural form (the one I am using) - Write application texts in Esperanto? Just kidding.