Django

Code

Ticket #6774 (closed: fixed)

Opened 7 months ago

Last modified 6 months ago

Use ugettext_lazy instead of ugettext in contrib.auth.forms

Reported by: Honza_Kral Assigned to: brosner
Milestone: Component: Contrib apps
Version: newforms-admin Keywords: nfa-blocker auth ugettext
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Currently ugettext is used in form fields' definitions. this breaks when the module is being impoerted during initialization (before the language is properly set).

The patch corrects the issue by using ugettext_lazy where appropriate.

Attachments

6774.nfa.diff (4.8 kB) - added by Honza_Kral on 03/14/08 15:16:08.

Change History

03/14/08 15:16:08 changed by Honza_Kral

  • attachment 6774.nfa.diff added.

04/16/08 15:06:34 changed by brosner

  • status changed from new to assigned.
  • needs_better_patch changed.
  • component changed from Uncategorized to Contrib apps.
  • needs_tests changed.
  • owner changed from nobody to brosner.
  • needs_docs changed.
  • has_patch set to 1.
  • stage changed from Unreviewed to Accepted.

This seems to be the right thing to do. It worked before because oldforms did this in its __init__ which ran during view execution. Any particular reason for the usage of ugettext name over just _?

04/16/08 15:38:36 changed by brosner

  • keywords changed from auth ugettext to nfa-blocker auth ugettext.

04/23/08 11:02:25 changed by brosner

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

(In [7449]) newforms-admin: Fixed #6774, #7068 -- Use ugettext_lazy instead of ugettext in django/contrib/auth/forms.py. Marked a few strings for translation in the forms.

04/23/08 11:27:33 changed by Piotr Lewandowski <django@icomputing.pl>

In [7449] label "Email" was introduced but the documentation states that "E-mail" is the right way to write it.

Attached patch has the "E-mail" label. Is there a reason for not writing it that way?

04/23/08 11:29:52 changed by brosner

Ah, thanks. My bad will fix now.


Add/Change #6774 (Use ugettext_lazy instead of ugettext in contrib.auth.forms)




Change Properties
Action