Code

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#6774 closed (fixed)

Use ugettext_lazy instead of ugettext in contrib.auth.forms

Reported by: Honza_Kral Owned by: brosner
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:

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_Kral 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by Honza_Kral

comment:1 Changed 6 years ago by brosner

  • Component changed from Uncategorized to Contrib apps
  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to brosner
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage 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 _?

comment:2 Changed 6 years ago by brosner

  • Keywords nfa-blocker added

comment:3 Changed 6 years ago by brosner

  • Resolution set to fixed
  • Status changed from assigned to closed

(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 Changed 6 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 6 years ago by brosner

Ah, thanks. My bad will fix now.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.