Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16298 closed New feature (wontfix)

Gettext by default on generated labels

Reported by: Vlastimil Zíma Owned by: nobody
Component: Translations Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

For model and form fields it would be nice to have default labels derived from its names translated.

It is much easier to make extra translations and add them to LOCALE_PATHS or merge them with generated translation than mess up code with extra parameter for every model field and form field.

Change History (3)

comment:1 by Aymeric Augustin, 13 years ago

If I understand correctly, the idea is to make this definition of Meta unnecessary:

from django.db import models
from django.utils.translation import ugettext_lazy as _
class Stuff(models.Model):
    class Meta:
        verbose_name = _("stuff")
        verbose_name_plural = _("stuffs")

One problem is that, if "stuff" and "stuffs" don't appear in Meta, they will no longer be discovered by makemessages.

comment:2 by Jannis Leidel, 13 years ago

Resolution: wontfix
Status: newclosed

Nope, sorry, this is a bad idea.

in reply to:  1 comment:3 by Vlastimil Zíma, 13 years ago

Replying to aaugustin:

If I understand correctly, the idea is to make this definition of Meta unnecessary:
One problem is that, if "stuff" and "stuffs" don't appear in Meta, they will no longer be discovered by makemessages.

No only that, mostly I have this problem with form fields such as

class SomeForm(forms.Form):
    name = forms.CharField(_('Name'))
    address = forms.CharField(_('Address'))
    country = forms.CharField(_('Country'))

For me this looks much worse than problem of discovery. Especially when adding extra translations could be done easily in LOCALE_PATHS. Create files with translations for such labels can be easily done by hand and does not have to be generated.

Note: See TracTickets for help on using tickets.
Back to Top