Opened 3 hours ago

#36691 new Bug

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 (1)

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

Download all attachments as: .zip

Change History (1)

by Carlos Sánchez López, 3 hours ago

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

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