Code

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4346 closed (invalid)

Model names are not translateable

Reported by: Marc Fargas <telenieko@…> Owned by: mtredinnick
Component: Internationalization Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

From my POV a model name is not translateable so it should not be called with _(...) on def str()
Happens with AnonymousUser in contrib/auth/models.py

Attachments (1)

modelclass.diff (380 bytes) - added by Marc Fargas <telenieko@…> 7 years ago.
Strips _()

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by Marc Fargas <telenieko@…>

Strips _()

comment:1 Changed 7 years ago by Marc Fargas <telenieko@…>

  • Has patch set

comment:2 Changed 7 years ago by mtredinnick

  • Resolution set to invalid
  • Status changed from new to closed

The {{{str}} method is not returning the model name. It's returning a string representation of the model that just happens to be the same as the model name and string representations are often translated. Plus, model names can be translated (they aren't by default, but they are if you specify verbose_name and mark it as translatable). So I don't think this is a bug.

comment:3 Changed 7 years ago by Marc Fargas <telenieko@…>

Ok! Thanks for the explanation :)

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.