[Django] #36378: Error message in MinimumLengthValidator.get_error_message is not translated

8 views
Skip to first unread message

Django

unread,
May 9, 2025, 2:54:01 AMMay 9
to django-...@googlegroups.com
#36378: Error message in MinimumLengthValidator.get_error_message is not translated
-------------------------------+----------------------------------------
Reporter: Marius Burfey | Type: Bug
Status: new | Component: contrib.auth
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+----------------------------------------
The translation files do not match the code:
- The code in
`django.contrib.auth.password_validation.MinimumLengthValidator.get_error_message`
expects a digit: `"This password is too short. It must contain at least %d
characters."`
- The translation file contains a named variable: `"This password is too
short. It must contain at least %(min_length)d characters."`

This does not match, so the error message is not translated.
--
Ticket URL: <https://code.djangoproject.com/ticket/36378>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 9, 2025, 3:56:00 AMMay 9
to django-...@googlegroups.com
#36378: Error message in MinimumLengthValidator.get_error_message is not translated
-------------------------------+--------------------------------------
Reporter: Marius Burfey | Owner: (none)
Type: Bug | Status: closed
Component: contrib.auth | Version: 5.2
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Sarah Boyce):

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

Comment:

This translation string changed in
ec7d69035a408b357f1803ca05a7c991cc358cfa. This means that the existing
translations were invalidated, they need updating in transifex for the new
format. Django keeps old translation strings when there were no further
translations which is why this looks confusing
Given the source strings have been updated and the translations are
already updated for some languages, I don't think it makes sense to revert
the change. It needs a volunteer to make updates in transifex
--
Ticket URL: <https://code.djangoproject.com/ticket/36378#comment:1>

Django

unread,
May 9, 2025, 3:59:48 AMMay 9
to django-...@googlegroups.com
#36378: Error message in MinimumLengthValidator.get_error_message is not translated
-------------------------------+--------------------------------------
Reporter: Marius Burfey | Owner: (none)
Type: Bug | Status: closed
Component: contrib.auth | Version: 5.2
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Marius Burfey):

* has_patch: 0 => 1

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

Django

unread,
May 9, 2025, 4:04:46 AMMay 9
to django-...@googlegroups.com
#36378: Error message in MinimumLengthValidator.get_error_message is not translated
-------------------------------+--------------------------------------
Reporter: Marius Burfey | Owner: (none)
Type: Bug | Status: closed
Component: contrib.auth | Version: 5.2
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Comment (by Marius Burfey):

Hey Sarah, thanks for looking into it.

I also had a look at the code, but went into the other direction: As the
translations match the format in "help_text" and I like named parameters
better, I created a PR to handle the error_message the same way. This
works for German without changing the translation files.

My only problem is a failing test which I don't understand...

What do you think about my approach?


Greetings from Cologne!
--
Ticket URL: <https://code.djangoproject.com/ticket/36378#comment:3>

Django

unread,
May 9, 2025, 4:15:07 AMMay 9
to django-...@googlegroups.com
#36378: Error message in MinimumLengthValidator.get_error_message is not translated
-------------------------------+--------------------------------------
Reporter: Marius Burfey | Owner: (none)
Type: Bug | Status: new
Component: contrib.auth | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Marius Burfey):

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

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

Django

unread,
May 9, 2025, 4:19:51 AMMay 9
to django-...@googlegroups.com
#36378: Error message in MinimumLengthValidator.get_error_message is not translated
-------------------------------+--------------------------------------
Reporter: Marius Burfey | Owner: (none)
Type: Bug | Status: new
Component: contrib.auth | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Comment (by Ronny Vedrilla):

Hi Sarah! 👋

I've tried to get access to the German translation about ~6 month ago but
still no approval 😅

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

Django

unread,
May 9, 2025, 4:31:45 AMMay 9
to django-...@googlegroups.com
#36378: Error message in MinimumLengthValidator.get_error_message is not translated
-------------------------------+--------------------------------------
Reporter: Marius Burfey | Owner: (none)
Type: Bug | Status: new
Component: contrib.auth | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Comment (by Sarah Boyce):

> This works for German without changing the translation files.
This is because German has not been updated, but quite a few other
languages have

For us to revert, we would need to:
- merge the code change and backport
- update the source strings in transifex
- this invalidates the translations that have been updated

We end up with some translated some not translated which is the current
state

We pull a refresh of translated resources for 5.2.2 (June 4th), so ideally
we would just update the German translation string
In hindsight, I should have spotted the translation change but it's quite
difficult to "undo".

> I've tried to get access to the German translation about ~6 month ago
but still no approval 😅

I have access to translate but not to approve people. I think we're
supposed to have language leads approve people but I think some languages
are abandoned. Let me see what I can do
--
Ticket URL: <https://code.djangoproject.com/ticket/36378#comment:6>

Django

unread,
May 9, 2025, 4:49:39 AMMay 9
to django-...@googlegroups.com
#36378: Error message in MinimumLengthValidator.get_error_message is not translated
-------------------------------+--------------------------------------
Reporter: Marius Burfey | Owner: (none)
Type: Bug | Status: new
Component: contrib.auth | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Comment (by Marius Burfey):

Replying to [comment:6 Sarah Boyce]:
> We end up with some translated some not translated which is the current
state
I understand, thanks. Changing again is not an option.


> We pull a refresh of translated resources for 5.2.2 (June 4th), so
ideally we would just update the German translation string
Which anybody (with access) could do, as it only changes the parameter.


> I have access to translate but not to approve people. I think we're
supposed to have language leads approve people but I think some languages
are abandoned. Let me see what I can do
Thank you!
--
Ticket URL: <https://code.djangoproject.com/ticket/36378#comment:7>

Django

unread,
May 9, 2025, 4:55:07 AMMay 9
to django-...@googlegroups.com
#36378: Error message in MinimumLengthValidator.get_error_message is not translated
-------------------------------+--------------------------------------
Reporter: Marius Burfey | Owner: (none)
Type: Bug | Status: closed
Component: contrib.auth | Version: 5.2
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Sarah Boyce):

* resolution: => wontfix
* status: new => closed

Comment:

> Dieses Passwort ist zu kurz. Es muss mindestens %d Zeichen enthalten.

Saved 🤞
--
Ticket URL: <https://code.djangoproject.com/ticket/36378#comment:8>
Reply all
Reply to author
Forward
0 new messages