[Django] #34738: Django admin doesn't translate error

23 views
Skip to first unread message

Django

unread,
Jul 25, 2023, 10:28:55 AM7/25/23
to django-...@googlegroups.com
#34738: Django admin doesn't translate error
-----------------------------------------+------------------------
Reporter: bevorderen | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.2
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 |
-----------------------------------------+------------------------
Hello.

To reproduce the bug you need:

1. Create an empty project with django 4.2
2. Change the LANGUAGE_CODE setting to "ru-RU"
3. Get error in admin panel "Please correct the error below." instead of
"Пожалуйста, исправьте ошибки ниже."

In version 4.1.7 everything works correctly

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

Django

unread,
Jul 25, 2023, 10:29:35 AM7/25/23
to django-...@googlegroups.com
#34738: Django admin doesn't translate error
-------------------------------+--------------------------------------

Reporter: bevorderen | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.2
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 bevorderen):

* Attachment "4.2.PNG" added.

Django

unread,
Jul 25, 2023, 10:32:44 AM7/25/23
to django-...@googlegroups.com
#34738: Django admin doesn't translate error
-------------------------------------+-------------------------------------
Reporter: Aleksandr Yudin | Owner: Aleksandr
| Yudin
Type: Bug | Status: assigned

Component: contrib.admin | Version: 4.2
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 Aleksandr Yudin):

* owner: nobody => Aleksandr Yudin
* status: new => assigned


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

Django

unread,
Jul 25, 2023, 12:47:27 PM7/25/23
to django-...@googlegroups.com
#34738: Django admin doesn't translate error
-------------------------------------+-------------------------------------
Reporter: Aleksandr Yudin | Owner: Aleksandr
| Yudin
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
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 Natalia Bidart):

* stage: Unreviewed => Accepted


Comment:

I can confirm there is something going on that may need further debugging.
At first I thought this was a missing translation string, but I checked
and the translation for `ru` is available. In fact, the following shows
the translated string:

{{{
<p>{% blocktranslate %}Please correct the errors below.{%
endblocktranslate %}</p>
}}}

But what's in the template:

{{{
<p>{% blocktranslate count counter=errors|length %}Please correct the
error below.{% plural %}Please correct the errors below.{%
endblocktranslate %}</p>
}}}

does not use the translated string. Accepting for now, I'll debug more
later today if no one beats me to it.

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

Django

unread,
Jul 25, 2023, 1:02:08 PM7/25/23
to django-...@googlegroups.com
#34738: Django admin doesn't translate error
-------------------------------------+-------------------------------------
Reporter: Aleksandr Yudin | Owner: Aleksandr
| Yudin
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: invalid

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 Claude Paroz):

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


Comment:

When a simple string is converted to a plural with blocktranslate count,
the language has to re-translate the string, gettext cannot reuse the
previously "simple" string. So please complete the Russian translation on
Transifex.

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

Django

unread,
Jul 25, 2023, 1:30:10 PM7/25/23
to django-...@googlegroups.com
#34738: Django admin doesn't translate error
-------------------------------------+-------------------------------------
Reporter: Aleksandr Yudin | Owner: Aleksandr
| Yudin
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: invalid
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 Natalia Bidart):

* stage: Accepted => Unreviewed


Comment:

Thank you Claude! A TIL for me :-)

I can see now how, for example, the `es` translation has
[https://github.com/django/django/blob/main/django/contrib/admin/locale/es/LC_MESSAGES/django.po
the following] for this case:

{{{
msgid "Please correct the error below."
msgid_plural "Please correct the errors below."
msgstr[0] "Por favor, corrija el siguiente error."
msgstr[1] "Por favor, corrija los siguientes errores."
msgstr[2] "Por favor, corrija los siguientes errores."
}}}

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

Django

unread,
Jul 26, 2023, 1:55:28 AM7/26/23
to django-...@googlegroups.com
#34738: Django admin doesn't translate error
-------------------------------------+-------------------------------------
Reporter: Aleksandr Yudin | Owner: Aleksandr
| Yudin
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Aleksandr Yudin):

Thank you!

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

Reply all
Reply to author
Forward
0 new messages