Opened 8 years ago

Closed 8 years ago

Last modified 5 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: 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)

internationalized_order_and_delete_labels_for_formsets.diff (5.6 KB) - added by Javier de la Rosa 8 years ago.
Patch file and regression test.
internationalized_order_and_delete_labels_for_formsets_r8554.diff (1.4 KB) - added by Manuel Saelices 8 years ago.
Patch without tests and using ugettext instead of ugettext_lazy

Download all attachments as: .zip

Change History (15)

comment:1 Changed 8 years ago by Javier de la Rosa

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

I attach a patch file.

Changed 8 years ago by Javier de la Rosa

Patch file and regression test.

comment:2 Changed 8 years ago by Manuel Saelices

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 8 years ago by Manuel Saelices

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

  $ django-admin.py makemessages -a

comment:4 Changed 8 years ago by Malcolm Tredinnick

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 Changed 8 years ago by Manuel Saelices

@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 8 years ago by Malcolm Tredinnick

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

comment:7 Changed 8 years ago by Manuel Saelices

Right :-)

comment:8 Changed 8 years ago by Manuel Saelices

Has patch: set

comment:9 Changed 8 years ago by Brian Rosner

Patch needs improvement: set

comment:9 Changed 8 years ago by Brian Rosner

Patch needs improvement: set

Changed 8 years ago by Manuel Saelices

Patch without tests and using ugettext instead of ugettext_lazy

comment:11 Changed 8 years ago by Jacob

Resolution: fixed
Status: assignedclosed

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

comment:12 Changed 8 years ago by Manuel Saelices

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

comment:13 Changed 5 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

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