Opened 9 months ago

Closed 9 months ago

Last modified 9 months ago

#34738 closed Bug (invalid)

Django admin doesn't translate error

Reported by: Aleksandr Yudin Owned by: Aleksandr Yudin
Component: contrib.admin Version: 4.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Attachments (1)

4.2.PNG (36.6 KB ) - added by Aleksandr Yudin 9 months ago.

Download all attachments as: .zip

Change History (6)

by Aleksandr Yudin, 9 months ago

Attachment: 4.2.PNG added

comment:1 by Aleksandr Yudin, 9 months ago

Owner: changed from nobody to Aleksandr Yudin
Status: newassigned

comment:2 by Natalia Bidart, 9 months ago

Triage Stage: UnreviewedAccepted

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.

comment:3 by Claude Paroz, 9 months ago

Resolution: invalid
Status: assignedclosed

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.

comment:4 by Natalia Bidart, 9 months ago

Triage Stage: AcceptedUnreviewed

Thank you Claude! A TIL for me :-)

I can see now how, for example, the es translation has 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."

comment:5 by Aleksandr Yudin, 9 months ago

Thank you!

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