Wrong plural translation for table name. Is this a bug?

hello, I have Django version 4.1.3. I have a simple category table:

class Category(models.Model):
    name = models.TextField()

    class Meta:
        verbose_name = _("category")
        verbose_name_plural = _("categories")

In english everything is fine.

I translate it to italian:

msgid "category"
msgstr "categoria"

msgid "categories"
msgstr "categorie"

The singular form works correctly. But the plural doesn’t, it’s not translated, it remains “categories”. And this happens only with this particular table. Other tables plurals are translated correctly. It feels like a bug caused by the italian translation of this plural word being exactly a prefix without the -s of the original word.

Where are you seeing this happen?

Can you provide some related code to that as well?

it’s happening in the admin panel, for example on the home of the admin panel with the main list of tables, but also in other places.

It’s a pretty minimal app, I don’t think there is other code that could be influencing this.

Have you compiled the messages again?
python manage.py compilemessages

I think I fixed it. I thought that

#, fuzzy

in the po file was just a comment. But apparently it matters somehow? It was before the categories translation.

From the translation docs:

Fuzzy entries

makemessages sometimes generates translation entries marked as fuzzy, e.g. when translations are inferred from previously translated strings. By default, fuzzy entries are not processed by compilemessages.

1 Like