Ticket #8543: internationalized_order_and_delete_labels_for_formsets_r8554.diff

File internationalized_order_and_delete_labels_for_formsets_r8554.diff, 1.4 KB (added by Manuel Saelices, 16 years ago)

Patch without tests and using ugettext instead of ugettext_lazy

  • django/forms/formsets.py

     
    11from forms import Form
    22from django.utils.encoding import StrAndUnicode
    33from django.utils.safestring import mark_safe
     4from django.utils.translation import ugettext as _
    45from fields import IntegerField, BooleanField
    56from widgets import Media, HiddenInput
    67from util import ErrorList, ValidationError
     
    238239        if self.can_order:
    239240            # Only pre-fill the ordering field for initial forms.
    240241            if index < self._initial_form_count:
    241                 form.fields[ORDERING_FIELD_NAME] = IntegerField(label='Order', initial=index+1, required=False)
     242                form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_(u'Order'), initial=index+1, required=False)
    242243            else:
    243                 form.fields[ORDERING_FIELD_NAME] = IntegerField(label='Order', required=False)
     244                form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_(u'Order'), required=False)
    244245        if self.can_delete:
    245             form.fields[DELETION_FIELD_NAME] = BooleanField(label='Delete', required=False)
     246            form.fields[DELETION_FIELD_NAME] = BooleanField(label=_(u'Delete'), required=False)
    246247
    247248    def add_prefix(self, index):
    248249        return '%s-%s' % (self.prefix, index)
Back to Top