[Django] #33985: ContentTypes and Permissions mix English with other languages in __str__

17 views
Skip to first unread message

Django

unread,
Sep 6, 2022, 11:37:22 AM9/6/22
to django-...@googlegroups.com
#33985: ContentTypes and Permissions mix English with other languages in __str__
-----------------------------------------+------------------------
Reporter: Meiyer | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 3.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
The string representation of
`django.contrib.contenttypes.models.ContentType` and
`django.contrib.auth.models.Permission` was changed in commit
[https://github.com/django/django/commit/48c17807a99f7a4341c74db19e16a37b010827c2
48c17807] to solve #16027. However, the `__str__` function mixes the
model’s `app_label` (which is not localized) with the model’s
`verbose_name` (which is localized). This results in weirdly looking
strings, part of which is in English and part in a different language, and
maybe even different alphabet.

The comment https://code.djangoproject.com/ticket/16027#comment:21 does
not clarify why the application’s `app_label` was chosen and not
`verbose_name` (via
`self._meta.apps.get_app_config(self.app_label).verbose_name`). In my
opinion, either the whole of the ContentType’s representation should use
localized labels or none of them should be localized.

--
Ticket URL: <https://code.djangoproject.com/ticket/33985>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 7, 2022, 1:55:34 AM9/7/22
to django-...@googlegroups.com
#33985: ContentTypes and Permissions mix English with other languages in __str__
-------------------------------+--------------------------------------
Reporter: Meiyer | Owner: arka1002
Type: Uncategorized | Status: assigned
Component: contrib.admin | Version: 3.0
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by arka1002):

* owner: nobody => arka1002
* status: new => assigned


Comment:

Hey! I'm going to work on it.

--
Ticket URL: <https://code.djangoproject.com/ticket/33985#comment:1>

Django

unread,
Sep 7, 2022, 10:22:24 AM9/7/22
to django-...@googlegroups.com
#33985: ContentTypes and Permissions mix English with other languages in __str__
-------------------------------+------------------------------------
Reporter: Meiyer | Owner: arka1002
Type: Bug | Status: assigned

Component: contrib.admin | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Carlton Gibson):

* type: Uncategorized => Bug
* stage: Unreviewed => Accepted


Comment:

OK, this seems reasonable to at least look at fixing.

Is https://github.com/django/django/pull/15573 related? (It looks like it,
but there's no ticket assigned yet, and no tests.)

--
Ticket URL: <https://code.djangoproject.com/ticket/33985#comment:2>

Django

unread,
Sep 8, 2022, 8:35:28 AM9/8/22
to django-...@googlegroups.com
#33985: ContentTypes and Permissions mix English with other languages in __str__
-------------------------------+------------------------------------
Reporter: Meiyer | Owner: (none)
Type: Bug | Status: new

Component: contrib.admin | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by arka1002):

* owner: arka1002 => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/33985#comment:3>

Django

unread,
Sep 13, 2022, 9:45:13 AM9/13/22
to django-...@googlegroups.com
#33985: ContentTypes and Permissions mix English with other languages in __str__
-------------------------------------+-------------------------------------
Reporter: Meiyer | Owner:
| Hrushikesh Vaidya
Type: Bug | Status: assigned

Component: contrib.admin | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hrushikesh Vaidya):

* owner: (none) => Hrushikesh Vaidya


* status: new => assigned

* has_patch: 0 => 1
* needs_tests: 0 => 1


Comment:

[https://github.com/django/django/pull/16053 PR]
I'm not quite sure how and where to add tests for this patch. Could you
give me some direction, @Carlton Gibson?

--
Ticket URL: <https://code.djangoproject.com/ticket/33985#comment:4>

Django

unread,
Jan 13, 2023, 12:12:52 PM1/13/23
to django-...@googlegroups.com
#33985: ContentTypes and Permissions mix English with other languages in __str__
-------------------------------------+-------------------------------------
Reporter: Meiyer | Owner:
| Hrushikesh Vaidya
Type: Bug | Status: assigned
Component: contrib.admin | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Josh Schneier):

* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/33985#comment:5>

Django

unread,
Mar 9, 2023, 4:31:33 AM3/9/23
to django-...@googlegroups.com
#33985: ContentTypes and Permissions mix English with other languages in __str__
-------------------------------------+-------------------------------------
Reporter: Meiyer | Owner:
| Hrushikesh Vaidya
Type: Bug | Status: assigned
Component: contrib.admin | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33985#comment:6>

Django

unread,
Mar 9, 2023, 5:19:27 AM3/9/23
to django-...@googlegroups.com
#33985: ContentTypes and Permissions mix English with other languages in __str__
-------------------------------------+-------------------------------------
Reporter: Meiyer | Owner:
| Hrushikesh Vaidya
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.0
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"a52bdea5a27ba44b13eda93642231c65c581e083" a52bdea5]:
{{{
#!CommitTicketReference repository=""
revision="a52bdea5a27ba44b13eda93642231c65c581e083"
Fixed #33985 -- Used app_config.verbose_name in ContentType.__str__().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33985#comment:7>

Reply all
Reply to author
Forward
0 new messages