# Permissions don't get translated in admin interface

**URL:** <https://forum.djangoproject.com/t/permissions-dont-get-translated-in-admin-interface/21324>\
**Category:** Internationalization\
**Created:** [June 2, 2023, 10:03pm UTC](https://forum.djangoproject.com/t/permissions-dont-get-translated-in-admin-interface/21324 "2023-06-02T22:03:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![thibaudcolas](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/thibaudcolas/32/3956_2.png) [@thibaudcolas](https://forum.djangoproject.com/u/thibaudcolas)\
**Post date:** [June 2, 2023, 10:03pm UTC](https://forum.djangoproject.com/t/permissions-dont-get-translated-in-admin-interface/21324/1 "2023-06-02T22:03:57Z")

</div>

👋 this is to discuss a potential re-opening (and fix?) of ticket [#1688 Permissions don’t get translated in admin interface](https://code.djangoproject.com/ticket/1688).

The issue was first reported in 2006. It was last raised by me in September 2022 [on the django-developers mailing list](https://groups.google.com/g/django-developers/c/Jv1GqGlp3ao) after having found it in my own testing. There wasn’t much feedback on the mailing list. People suggested workarounds, while I want to make the case for this to be directly fixed in Django. On Discord, @nessita suggested taking the discussion to the forum. to see whether there might be more feedback here.

---

<div class="post-metadata">

**Author:** ![thibaudcolas](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/thibaudcolas/32/3956_2.png) [@thibaudcolas](https://forum.djangoproject.com/u/thibaudcolas)\
**Post date:** [June 2, 2023, 10:04pm UTC](https://forum.djangoproject.com/t/permissions-dont-get-translated-in-admin-interface/21324/2 "2023-06-02T22:04:31Z")

</div>

For people catching up on this – here is a good illustration of the problem as of Django `main` from today – translation names aren’t translated (while other parts of the label are):

 ![permission-names-django-Django-5.0.dev20230602105440](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/d/da901e1ad9a25915b43e4b0860fc3e880a2e08e9.png)

As noted by @felixxm, this was recently improved thanks to [a52bdea5a27ba44b13eda93642231c65c581e083](https://github.com/django/django/commit/a52bdea5a27ba44b13eda93642231c65c581e083).

I have worked on two proof-of-concept fixes here: [thibaudcolas/django#1](https://github.com/thibaudcolas/django/pull/1). The PoCs aren’t necessarily correct but (I think) demonstrate this can be fixed even while keeping translation names in the database.

A more brute-force approach would also be to simply duplicate the DB-stored strings in a file where they can be processed by `makemessages`, and pass the DB output to `gettext`.

So there are options to fix this – and first off I’d like to make the case for this ticket to be re-opened & accepted.

---

<div class="post-metadata">

**Author:** ![smithdc1](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/smithdc1/32/23160_2.png) [@smithdc1](https://forum.djangoproject.com/u/smithdc1)\
**Post date:** [June 3, 2023, 6:37am UTC](https://forum.djangoproject.com/t/permissions-dont-get-translated-in-admin-interface/21324/3 "2023-06-03T06:37:54Z")

</div>

If we have reasonable options too fix then I’d be +1 to reopen.

---

<div class="post-metadata">

**Author:** ![carltongibson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/carltongibson/32/267_2.png) [@carltongibson](https://forum.djangoproject.com/u/carltongibson)\
**Post date:** [June 3, 2023, 8:48am UTC](https://forum.djangoproject.com/t/permissions-dont-get-translated-in-admin-interface/21324/4 "2023-06-03T08:48:19Z")

</div>

Hi @thibaudcolas — thanks for the persistence here 🏅

I agree that the reasons for closing don’t seem that great, so with a reasonable fix I’d be +1 too. (Surely it’s a good win if we can…)

---

<div class="post-metadata">

**Author:** ![adamchainz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/adamchainz/32/26_2.png) [@adamchainz](https://forum.djangoproject.com/u/adamchainz)\
**Post date:** [June 4, 2023, 9:47pm UTC](https://forum.djangoproject.com/t/permissions-dont-get-translated-in-admin-interface/21324/5 "2023-06-04T21:47:25Z")

</div>

I don’t have much experience with translations, but +1 since the PoC seems small and reasonable.

(What about extending to custom permissions? Users can’t easily override `Permission. __str__ `…)

---

<div class="post-metadata">

**Author:** ![nessita](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nessita/32/12194_2.png) [@nessita](https://forum.djangoproject.com/u/nessita)\
**Post date:** [June 6, 2023, 1:00pm UTC](https://forum.djangoproject.com/t/permissions-dont-get-translated-in-admin-interface/21324/6 "2023-06-06T13:00:56Z")

</div>

Hello! As mentioned in the Discord chat, I agree this functionality request makes sense and I feel we should revisit the topic with a more inclusive and open mind. So +1 from me!

Regarding solution, one idea that occurred to me is the following:

- Could `makemessages` be extended so the permission labels are read from the DB and added as requiring translation to the proper `.po` file?  
Then translators would translate those permission labels (strings) as usual, and then we’d need some machinery to try to load translations for permission labels when displaying them in the UI.

This process could eventually be generalized to mark “any db column” as translatable, though I would certainly not go that far in an initial implementation.

Thanks, Natalia.

---

<div class="post-metadata">

**Author:** ![felixxm](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/felixxm/32/2479_2.png) [@felixxm](https://forum.djangoproject.com/u/felixxm)\
**Post date:** [June 7, 2023, 11:04am UTC](https://forum.djangoproject.com/t/permissions-dont-get-translated-in-admin-interface/21324/7 "2023-06-07T11:04:50Z")

</div>

> [@nessita](#):
>
> This process could eventually be generalized to mark “any db column” as translatable, though I would certainly not go that far in an initial implementation.

We have a 3rd-party package for this, see [django-modeltranslation](https://github.com/deschler/django-modeltranslation).

---

<div class="post-metadata">

**Author:** ![nessita](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nessita/32/12194_2.png) [@nessita](https://forum.djangoproject.com/u/nessita)\
**Post date:** [June 7, 2023, 6:10pm UTC](https://forum.djangoproject.com/t/permissions-dont-get-translated-in-admin-interface/21324/8 "2023-06-07T18:10:32Z")

</div>

> [@felixxm](#):
>
> We have a 3rd-party package for this, see [django-modeltranslation](https://github.com/deschler/django-modeltranslation).

Ah, thanks for the pointer! I had no idea. So where does this leaves us/Django? Shall we aim at accepting the ticket and merging something along of the lines of what @thibaudcolas is proposing?

---

<div class="post-metadata">

**Author:** ![felixxm](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/felixxm/32/2479_2.png) [@felixxm](https://forum.djangoproject.com/u/felixxm)\
**Post date:** [June 9, 2023, 5:53am UTC](https://forum.djangoproject.com/t/permissions-dont-get-translated-in-admin-interface/21324/9 "2023-06-09T05:53:02Z")

</div>

> [@nessita](#):
>
> Shall we aim at accepting the ticket and merging something along of the lines of what @thibaudcolas is proposing?

That sounds acceptable.
