Code

Opened 6 months ago

Closed 6 months ago

#21324 closed Bug (fixed)

CSRF failure view not translated

Reported by: claudep Owned by: bouke
Component: Internationalization Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As noted in #21322, the CSRF "Forbidden" view is showing untranslatable content to the end user, which is not nice. We can assume the DEBUG=True part is more developer-oriented, but the text showing to users on production setups should be translated.

Attachments (1)

21324.diff (4.4 KB) - added by claudep 6 months ago.

Download all attachments as: .zip

Change History (7)

Changed 6 months ago by claudep

comment:1 Changed 6 months ago by claudep

  • Has patch set

comment:2 Changed 6 months ago by bmispelon

  • Needs documentation set
  • Needs tests set
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

I think it's a valid feature request.

A full patch should include tests, a mention in the release notes and maybe a comment in the code explaining why we're using string formatting instead of the i18n template tags (from what I understand, it's because the strings to be translated wouldn't be discovered by makemessages otherwise).

comment:3 Changed 6 months ago by claudep

  • Status changed from new to assigned

comment:4 Changed 6 months ago by claudep

  • Owner claudep deleted
  • Status changed from assigned to new

comment:5 Changed 6 months ago by bouke

  • Needs tests unset
  • Owner set to bouke
  • Patch needs improvement unset
  • Status changed from new to assigned

updated the patch and added tests: https://github.com/django/django/pull/1844

comment:6 Changed 6 months ago by Claude Paroz <claude@…>

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

In 61074353864293d3ea51e51e09cf4deedee12963:

Fixed #21324 -- Translate CSRF failure view

Thanks to Claude Paroz for the original patch.

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.