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 Sarah Boyce, 4 months ago

Resolution: invalid
Status: newclosed

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

comment:2 by Marius Burfey, 4 months ago

Has patch: set

comment:3 by Marius Burfey, 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!

Last edited 4 months ago by Marius Burfey (previous) (diff)

comment:4 by Marius Burfey, 4 months ago

Resolution: invalid
Status: closednew

comment:5 by Ronny Vedrilla, 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

comment:6 by Sarah Boyce, 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

in reply to:  6 comment:7 by Marius Burfey, 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 Sarah Boyce, 4 months ago

Resolution: wontfix
Status: newclosed

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

Saved 🤞

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