Code

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 msaelices, 6 years ago)

Patch without tests and using ugettext instead of ugettext_lazy

Line 
1Index: django/forms/formsets.py
2===================================================================
3--- django/forms/formsets.py    (revisión: 8554)
4+++ django/forms/formsets.py    (copia de trabajo)
5@@ -1,6 +1,7 @@
6 from forms import Form
7 from django.utils.encoding import StrAndUnicode
8 from django.utils.safestring import mark_safe
9+from django.utils.translation import ugettext as _
10 from fields import IntegerField, BooleanField
11 from widgets import Media, HiddenInput
12 from util import ErrorList, ValidationError
13@@ -238,11 +239,11 @@
14         if self.can_order:
15             # Only pre-fill the ordering field for initial forms.
16             if index < self._initial_form_count:
17-                form.fields[ORDERING_FIELD_NAME] = IntegerField(label='Order', initial=index+1, required=False)
18+                form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_(u'Order'), initial=index+1, required=False)
19             else:
20-                form.fields[ORDERING_FIELD_NAME] = IntegerField(label='Order', required=False)
21+                form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_(u'Order'), required=False)
22         if self.can_delete:
23-            form.fields[DELETION_FIELD_NAME] = BooleanField(label='Delete', required=False)
24+            form.fields[DELETION_FIELD_NAME] = BooleanField(label=_(u'Delete'), required=False)
25 
26     def add_prefix(self, index):
27         return '%s-%s' % (self.prefix, index)