Opened 14 years ago
Closed 14 years ago
#15971 closed Bug (fixed)
The titles of admin list_filters aren't translated anymore
Reported by: | Matthias Kestenholz | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
FieldListFilter.title is not initialized with verbose_name of fields anymore but with field_path instead. Because of this the admin change_list shows 'Nach status' and 'Nach visitor_name' instead of 'Nach Status' and 'Nach Besucher'.
Attachments (2)
Change History (11)
by , 14 years ago
Attachment: | 15971.diff added |
---|
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 14 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
This looks like a duplicate of #15221
by , 14 years ago
Attachment: | 15971.admin-filter-verbose-name.diff added |
---|
comment:4 by , 14 years ago
Resolution: | duplicate |
---|---|
Severity: | Normal → Release blocker |
Status: | closed → reopened |
#15221 is a related, but different issue. #15221 is for displaying the _RelatedFieldListFilter_'s title properly.
But thanks, I was just going to point to it :-)
This ticket here is a regression (whereas the issue in #15221 has always been there), hence marking as blocker. The attached patch checks for the existence of a verbose_name
attribute, similar to the approach in the patch for #15221 (which I'm also going to update in a minute).
comment:5 by , 14 years ago
I don't think the patch fixes the whole issue. We should be able to display a proper verbose_name even for related objects (to support something like list_filter = ('related__object__attribute',)
Or am I misunderstanding something?
comment:6 by , 14 years ago
@mk: Agreed, which is what #15221 is suggesting. However, the patch here addresses the regression only, which is a slightly different issue.
FieldListFilter
, as a super class, should avoid trying to guess about its child classes' business. The best it can do is provide a sensible default (i.e. verbose_name
if possible, or field_path
if not). The patch in #15221 lets RelatedFieldListFilter
(i.e. the child class) override this default behaviour.
Again, this ticket is about fixing a regression that was introduced by [16144]. #15221 is about fixing a behaviour that has always existed.
Hope that makes sense :-)
comment:8 by , 14 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
The attached patch probably needs improvement, but I'll leave that to someone else.
I think the tests are verifying the wrong behavior here, too.