Django

Code

Ticket #8543 (closed: fixed)

Opened 3 months ago

Last modified 3 months ago

can_delete and can_order labels are not internationalized

Reported by: versae Assigned to: versae
Milestone: 1.0 Component: Forms
Version: SVN Keywords: string-freeze
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 1

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

internationalized_order_and_delete_labels_for_formsets.diff (5.6 kB) - added by versae on 08/25/08 13:49:38.
Patch file and regression test.
internationalized_order_and_delete_labels_for_formsets_r8554.diff (1.4 kB) - added by msaelices on 08/25/08 14:41:46.
Patch without tests and using ugettext instead of ugettext_lazy

Change History

08/25/08 13:48:57 changed by versae

  • owner changed from versae@gmail.com to versae.
  • needs_better_patch changed.
  • status changed from new to assigned.
  • needs_tests changed.
  • needs_docs changed.

I attach a patch file.

08/25/08 13:49:38 changed by versae

  • attachment internationalized_order_and_delete_labels_for_formsets.diff added.

Patch file and regression test.

08/25/08 13:58:38 changed by msaelices

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

08/25/08 14:03:06 changed by msaelices

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

  $ django-admin.py makemessages -a

08/25/08 14:09:27 changed by mtredinnick

  • keywords set to string-freeze.
  • stage changed from Unreviewed to Accepted.
  • milestone set to 1.0.

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.

08/25/08 14:17:15 changed by msaelices

@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?

08/25/08 14:19:54 changed by mtredinnick

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

08/25/08 14:21:54 changed by msaelices

Right :-)

08/25/08 14:26:26 changed by msaelices

  • has_patch set to 1.

08/25/08 14:32:24 changed by brosner

  • needs_better_patch set to 1.

08/25/08 14:32:26 changed by brosner

  • needs_better_patch set to 1.

08/25/08 14:41:46 changed by msaelices

  • attachment internationalized_order_and_delete_labels_for_formsets_r8554.diff added.

Patch without tests and using ugettext instead of ugettext_lazy

08/25/08 17:55:25 changed by jacob

  • status changed from assigned to closed.
  • resolution set to fixed.

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

08/25/08 18:11:55 changed by msaelices

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


Add/Change #8543 (can_delete and can_order labels are not internationalized)




Change Properties
Action