Opened 10 months ago

Last modified 2 weeks ago

#21113 assigned New feature

django_admin_log table stores messages in different languages depending on which language was active while editing.

Reported by: dimyur27@… Owned by: jooyous
Component: contrib.admin Version: master
Severity: Normal Keywords: admin logs i18n
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In my project (in development) there are 3 different languages supported. Admin site supposed to have 3 main superusers, each is a native speaker of one of the languages. If one superuser edited an object, another one is not able to read what his fellow superuser previously did, because "Change history" page doesn't respect the current user language and displays the messages in the language that was current when the changes took place.
Maybe change_message field should be removed and the messages generated each time they are displayed.
So is object_repr, because object's representation may be dependant on the current language too.
Thank you.

Attachments (0)

Change History (7)

comment:1 Changed 10 months ago by wim@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted
  • Version changed from 1.6-beta-1 to master

Accepted. I'd like messages to be language-agnostic and translatable.

comment:2 Changed 9 months ago by timo

  • Type changed from Uncategorized to New feature

comment:3 Changed 3 weeks ago by jooyous

  • Owner changed from nobody to jooyous
  • Status changed from new to assigned

comment:4 Changed 3 weeks ago by jooyous

So at this point I understand how to change this so all subsequent log entries behave correctly. But currently the translated strings are being saved away as part of the object, and I think (?) this means we've lost the information of the starting language, so the only way I can think of fixing *existing* histories is by writing a script and having the user run it, specifying their relevant languages?

comment:5 Changed 3 weeks ago by claudep

Fixing existing history might be impossible to achieve. I wouldn't set that as a goal for this ticket.

comment:6 follow-up: Changed 2 weeks ago by anonymous

I can't get ugettext to translate "Changed" for some reason, even though there are bits of code where it does it successfully and I'm not sure what I'm doing wrong.

comment:7 in reply to: ↑ 6 Changed 2 weeks ago by jooyous

Replying to anonymous:

I can't get ugettext to translate "Changed" for some reason, even though there are bits of code where it does it successfully and I'm not sure what I'm doing wrong.

Whoops, that was me. Didn't realize I was logged out.

Add Comment

Modify Ticket

Change Properties
<Author field>
as assigned
The owner will be changed from jooyous to anonymous. Next status will be 'assigned'
The ticket will be disowned. Next status will be 'new'
as The resolution will be set. Next status will be 'closed'

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

Note: See TracTickets for help on using tickets.