I18n translation of model form in Django

django, django-forms, django-models, internationalization, translation

Solution

from django.utils.translation import ugettext_lazy as _

class Show(models.Model):
    discount_tickets = models.IntegerField(_("Discount Tickets"))
    regular_tickets = models.IntegerField(_("Regular Tickets"))
    afillate_price = models.IntegerField(_("Afillate Price"))
    user_price = models.IntegerField(_("User Price"))
    start_time = models.CharField(_("Event Time"), max_length=20)
    sale_end_time = models.CharField(_("Sale End Time"), max_length=20) 

Problem

I have a form that I want to translate: Models.py: ``` class Show(models.Model): discount_tickets = models.IntegerField("Discount Tickets") regular_tickets = models.IntegerField("Regular Tickets") afillate_price = models.IntegerField("Afillate Price") user_price = models.IntegerField("User Price") start_time = models.CharField("Event Time", max_length=20) sale_end_time = models.CharField("Sale End Time", max_length=20) def __unicode__(self): return unicode(self.discount_tickets) class ShowForm(ModelForm): pass class Meta: model = Show ``` How can I translate the field names?

Original source