#8543 closed (fixed)
can_delete and can_order labels are not internationalized
Reported by: | Javier de la Rosa | Owned by: | Javier de la Rosa |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Keywords: | string-freeze | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
In forms/formsets.py, lines 241, 243 and 245:
[...] form.fields[ORDERING_FIELD_NAME] = IntegerField(label='Order', initial=index+1, required=False) else: form.fields[ORDERING_FIELD_NAME] = IntegerField(label='Order', required=False) if self.can_delete: form.fields[DELETION_FIELD_NAME] = BooleanField(label='Delete', required=False) [...]
I think this should be
[...] form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_('Order'), initial=index+1, required=False) else: form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_('Order'), required=False) if self.can_delete: form.fields[DELETION_FIELD_NAME] = BooleanField(label=_('Delete'), required=False) [...]
I attach a patch file.
Attachments (2)
Change History (15)
comment:1 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 16 years ago
Attachment: | internationalized_order_and_delete_labels_for_formsets.diff added |
---|
Patch file and regression test.
comment:2 by , 16 years ago
You've missed upload the .mo file to patch. You can do this with this order (executed in django/conf
dir):
$ django-admin.py compilemessages
comment:3 by , 16 years ago
Also you missed putting that new msgid in other catalogs, with this command:
$ django-admin.py makemessages -a
comment:4 by , 16 years ago
Keywords: | string-freeze added |
---|---|
milestone: | → 1.0 |
Triage Stage: | Unreviewed → Accepted |
Woah, woah.. everybody slow down! This patch should only be adding the ugettext_lazy()
call to the source. That is the internationalisation bug.
The localisation updates will be done by the respective translators. Code patches should never touch message catalogs (nor should MO files ever be put into a translation patch, since they are regenerated before commits). Putting a translation update into a code patch is mixing two separate things.
comment:5 by , 16 years ago
@mtredinnick, ok, you're right, but in this case, for the regression tests, you at least need put the spanish translation of "Order"
. The test case will fail in other case.
what do you think about this?
comment:6 by , 16 years ago
Leave the test out. We don't need a test for every translated string in Django.
comment:8 by , 16 years ago
Has patch: | set |
---|
comment:9 by , 16 years ago
Patch needs improvement: | set |
---|
comment:9 by , 16 years ago
Patch needs improvement: | set |
---|
by , 16 years ago
Attachment: | internationalized_order_and_delete_labels_for_formsets_r8554.diff added |
---|
Patch without tests and using ugettext instead of ugettext_lazy
comment:11 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:12 by , 16 years ago
@jacob, it's better to give thanks to Versae. He created the first patch :-)
I attach a patch file.