Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#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)

internationalized_order_and_delete_labels_for_formsets.diff (5.6 KB ) - added by Javier de la Rosa 16 years ago.
Patch file and regression test.
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

Download all attachments as: .zip

Change History (15)

comment:1 by Javier de la Rosa, 16 years ago

Owner: changed from versae@… to Javier de la Rosa
Status: newassigned

I attach a patch file.

by Javier de la Rosa, 16 years ago

Patch file and regression test.

comment:2 by Manuel Saelices, 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 Manuel Saelices, 16 years ago

Also you missed putting that new msgid in other catalogs, with this command:

  $ django-admin.py makemessages -a

comment:4 by Malcolm Tredinnick, 16 years ago

Keywords: string-freeze added
milestone: 1.0
Triage Stage: UnreviewedAccepted

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 Manuel Saelices, 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 Malcolm Tredinnick, 16 years ago

Leave the test out. We don't need a test for every translated string in Django.

comment:7 by Manuel Saelices, 16 years ago

Right :-)

comment:8 by Manuel Saelices, 16 years ago

Has patch: set

comment:9 by Brian Rosner, 16 years ago

Patch needs improvement: set

comment:9 by Brian Rosner, 16 years ago

Patch needs improvement: set

by Manuel Saelices, 16 years ago

Patch without tests and using ugettext instead of ugettext_lazy

comment:11 by Jacob, 16 years ago

Resolution: fixed
Status: assignedclosed

(In [8562]) Fixed #8543: added translation markings to can_delete and can_order form labels. Thanks, msaelices.

comment:12 by Manuel Saelices, 16 years ago

@jacob, it's better to give thanks to Versae. He created the first patch :-)

comment:13 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top