Opened 64 minutes ago
#37527 new Bug
MinimumLengthValidator error message is not translated to Czech (cs) when LANGUAGE_CODE = 'cs'
| Reported by: | bomot | Owned by: | |
|---|---|---|---|
| Component: | contrib.auth | Version: | 6.1 |
| 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
# Description
When LANGUAGE_CODE is set to 'cs' (Czech) and USE_I18N = True (without LocaleMiddleware), the validation error message from MinimumLengthValidator ("This password is too short. It must contain at least %(min_length)d characters.") is rendered in English instead of Czech.
This reproduces both in standard Django forms (UserCreationForm) and with third-party packages like django-allauth.
# Steps to Reproduce
- Create a clean Django project.
- In
settings.py, setLANGUAGE_CODE = 'cs'andUSE_I18N = True. EnsureLocaleMiddlewareis not inMIDDLEWARE(so browserAccept-Languageheaders do not interfere). - Ensure
django.contrib.auth.password_validation.MinimumLengthValidatoris active inAUTH_PASSWORD_VALIDATORS. - Render a registration/password form (e.g.,
UserCreationForm) and submit a password shorter than 8 characters. - Inspect
{{ form.password1.errors }}(or{{ form.password2.errors }}).
# Expected Behavior
The error message should be translated into Czech.
# Actual Behavior
The error message is rendered in English:
This password is too short. It must contain at least 8 characters.
# Environment
- Django version: [6.1.3]
- Python version: [3.14.10]
Thank you for developing and maintaining such a great framework!