Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#6774 closed (fixed)

Use ugettext_lazy instead of ugettext in contrib.auth.forms

Reported by: Honza Král Owned by: Brian Rosner
Component: Contrib apps Version: newforms-admin
Severity: Keywords: nfa-blocker auth ugettext
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 (1)

6774.nfa.diff (4.8 KB ) - added by Honza Král 16 years ago.

Download all attachments as: .zip

Change History (6)

by Honza Král, 16 years ago

Attachment: 6774.nfa.diff added

comment:1 by Brian Rosner, 16 years ago

Component: UncategorizedContrib apps
Has patch: set
Owner: changed from nobody to Brian Rosner
Status: newassigned
Triage Stage: UnreviewedAccepted

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

comment:2 by Brian Rosner, 16 years ago

Keywords: nfa-blocker added

comment:3 by Brian Rosner, 16 years ago

Resolution: fixed
Status: assignedclosed

(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.

comment:4 by Piotr Lewandowski <django@…>, 16 years ago

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?

comment:5 by Brian Rosner, 16 years ago

Ah, thanks. My bad will fix now.

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