On Dienstag, 6. Februar 2007, Matias wrote:
> Hi,
>
> I've a class named "Category", but this application must be in
> Spanish, so I need it to be displayed on the Admin interface as
> "Categoria". ¿how can I accomplish that?
>
> Here is the model definition:
>
> class Category(models.Model):
> name = models.CharField('Nombre',maxlength=40)
> description = models.CharField('Descripción',maxlength=250)
> def __str__(self):
> return self.name
> class Admin:
> pass
Do you already use Django's i18n support? In this case you can mark the
verbose_name and verbose_name_plural strings as translateable. Then
create-messages.py will find it when executed the next time.
# ---------------------------------------------------------
from django.utils.translation import gettext_lazy as _
class Category(models.Model):
[...]
class Meta:
verbose_name = _('Category')
verbose_name_plural = _('Categories')
# ---------------------------------------------------------
See http://www.djangoproject.com/documentation/i18n/ for details about
Django's i18n support.
Best Regards,
Dirk Eschler
--
Dirk Eschler <mailto:[EMAIL PROTECTED]>
http://www.krusader.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---