你怎么能告诉ugettext复数形式不是单数形式,即使它们在英语中是相同的?
class News(models.Model):
class Meta:
verbose_name = _('news')
verbose_name_plural = _('news')
makemessages给出了这个:
#: models.py:134, models.:135
msgid "news"
msgstr "noticia"
分割此定义会使用“重复消息定义...”
来中断编译我找到的解决方法:
答案 0 :(得分:3)
尝试:
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")