Opened 3 years ago

Closed 3 years ago

#21324 closed Bug (fixed)

CSRF failure view not translated

Reported by: Claude Paroz Owned by: Bouke Haarsma
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 Claude Paroz 3 years ago.

Download all attachments as: .zip

Change History (7)

Changed 3 years ago by Claude Paroz

Attachment: 21324.diff added

comment:1 Changed 3 years ago by Claude Paroz

Has patch: set

comment:2 Changed 3 years ago by Baptiste Mispelon

Needs documentation: set
Needs tests: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

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 3 years ago by Claude Paroz

Status: newassigned

comment:4 Changed 3 years ago by Claude Paroz

Owner: Claude Paroz deleted
Status: assignednew

comment:5 Changed 3 years ago by Bouke Haarsma

Needs tests: unset
Owner: set to Bouke Haarsma
Patch needs improvement: unset
Status: newassigned

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

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

Resolution: fixed
Status: assignedclosed

In 61074353864293d3ea51e51e09cf4deedee12963:

Fixed #21324 -- Translate CSRF failure view

Thanks to Claude Paroz for the original patch.

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