Opened 4 weeks ago

Closed 4 weeks ago

#36691 closed Bug (worksforme)

Spanish translation missing for some error messages in Django 5.2.7

Reported by: Carlos Sánchez López Owned by:
Component: Internationalization Version: 5.2
Severity: Normal Keywords: translation, spanish, validation, obsolete
Cc: Carlos Sánchez López Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Expected behavior

Email validation error should display in Spanish: "Introduzca una dirección de correo electrónico válida."

Actual behavior

Error displays in English: "Enter a valid email address."

Note: All other Django admin messages (form errors, labels, etc.) correctly display in Spanish.
Only this specific email validation message appears in English.

Configuration

  • Django Version: 5.2.7
  • Python Version: 3.13
  • settings.py:
    ...
    MIDDLEWARE = [
       ...
        'django.contrib.sessions.middleware.SessionMiddleware',
        'django.middleware.locale.LocaleMiddleware',
        'django.middleware.common.CommonMiddleware',
        ...
    ]
    ...
    LANGUAGE_CODE = 'es'
    USE_I18N = True
    LANGUAGES = [('es', 'Spanish')]
    ...
    

Investigation

Confirmed the English string is still used in Django's validator:

$ grep -i "email" env/lib/python3.13/site-packages/django/core/validators.py | grep -i "message"
    message = _("Enter a valid email address.")

Checked Spanish locale file - translation exists but is marked as obsolete (#~):

$ grep -i "correo" env/lib/python3.13/site-packages/django/conf/locale/es/LC_MESSAGES/django.po
#~ msgstr "Introduzca una dirección de correo electrónico válida."
#~ msgstr "Correo electrónico"
#~ msgstr "Introduzca una dirección de correo electrónico válida."
#~ msgstr "Correo electrónico"

Confirmed no active (non-obsolete) translation exists:

$ grep -i "valid.*email" env/lib/python3.13/site-packages/django/conf/locale/es/LC_MESSAGES/django.po | grep -v "^#"
# no results returned

Verified the compiled .mo file doesn't contain the translation:

$ msgunfmt env/lib/python3.13/site-packages/django/conf/locale/es/LC_MESSAGES/django.mo | grep -i "email"
# no results returned

Attachments (2)

Screenshot From 2025-10-27 14-22-31.2.png (42.7 KB ) - added by Carlos Sánchez López 4 weeks ago.
Screenshot of the email validation error at the bottom. Notice everything else from the admin site is correctly showing up in Spanish.
image-20251027-221825.png (85.6 KB ) - added by Natalia Bidart 4 weeks ago.

Download all attachments as: .zip

Change History (4)

by Carlos Sánchez López, 4 weeks ago

Screenshot of the email validation error at the bottom. Notice everything else from the admin site is correctly showing up in Spanish.

by Natalia Bidart, 4 weeks ago

Attachment: image-20251027-221825.png added

comment:1 by Natalia Bidart, 4 weeks ago

Hola Carlos, thank you for your ticket. I have double checked using a clean Django 5.2.7 project, and also using Django from the main branch. In both cases, the error string is shown as translated. See the screenshot attached.

I'll close as worksforme, this seems to be an issue with your environment. Before reopening, please make sure that you can provide reproducible steps. You can also seek further help using any of the user support channels from this link.


comment:2 by Natalia Bidart, 4 weeks ago

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top