Opened 4 months ago
Closed 4 months ago
#36378 closed Bug (wontfix)
Error message in MinimumLengthValidator.get_error_message is not translated
Reported by: | Marius Burfey | Owned by: | |
---|---|---|---|
Component: | contrib.auth | Version: | 5.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
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.
Change History (8)
comment:1 by , 4 months ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 4 months ago
Has patch: | set |
---|
comment:3 by , 4 months ago
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.
What do you think about my approach?
Greetings from Cologne!
comment:4 by , 4 months ago
Resolution: | invalid |
---|---|
Status: | closed → new |
comment:5 by , 4 months ago
Hi Sarah! 👋
I've tried to get access to the German translation about ~6 month ago but still no approval 😅
Best
Ronny
follow-up: 7 comment:6 by , 4 months ago
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
comment:7 by , 4 months ago
Replying to 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!
comment:8 by , 4 months ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Dieses Passwort ist zu kurz. Es muss mindestens %d Zeichen enthalten.
Saved 🤞
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