Opened 10 years ago

Closed 10 years ago

Last modified 10 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: UI/UX:


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 10 years ago.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by Honza Král

Attachment: 6774.nfa.diff added

comment:1 Changed 10 years ago by Brian Rosner

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 Changed 10 years ago by Brian Rosner

Keywords: nfa-blocker added

comment:3 Changed 10 years ago by Brian Rosner

Resolution: fixed
Status: assignedclosed

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

comment:4 Changed 10 years ago by Piotr Lewandowski <django@…>

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 Changed 10 years ago by Brian Rosner

Ah, thanks. My bad will fix now.

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