#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: | master |
Severity: | Keywords: | string-freeze | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | UI/UX: |
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 Changed 10 years ago by
Owner: | changed from versae@… to Javier de la Rosa |
---|---|
Status: | new → assigned |
Changed 10 years ago by
Attachment: | internationalized_order_and_delete_labels_for_formsets.diff added |
---|
Patch file and regression test.
comment:2 Changed 10 years ago by
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 Changed 10 years ago by
Also you missed putting that new msgid in other catalogs, with this command:
$ django-admin.py makemessages -a
comment:4 Changed 10 years ago by
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 Changed 10 years ago by
@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 Changed 10 years ago by
Leave the test out. We don't need a test for every translated string in Django.
comment:8 Changed 10 years ago by
Has patch: | set |
---|
comment:9 Changed 10 years ago by
Patch needs improvement: | set |
---|
comment:9 Changed 10 years ago by
Patch needs improvement: | set |
---|
Changed 10 years ago by
Attachment: | internationalized_order_and_delete_labels_for_formsets_r8554.diff added |
---|
Patch without tests and using ugettext instead of ugettext_lazy
comment:11 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:12 Changed 10 years ago by
@jacob, it's better to give thanks to Versae. He created the first patch :-)
I attach a patch file.