Localization of form validation errors

I have set up different languages in my Django web-app. It works well, but the error messages from form validation are only in English language. How to translate them?

I’ve googled this topic, but haven’t found answer to my question.

Could you tell us if the error messages are yours or those from the Django code?

Oops, sorry, should’ve mentioned.

These errors come only from Django. And there is no client-side validation.

I’ve also used django-crispy-forms, I thought, maybe it provides own messages, but no. The problem stays even without | crispy filter.

At this stage, it will be difficult to help you without some code to reproduce the issue (maybe with a minimal project?).

No problem, I’ll spend some time

Oh, actually. Does it translates? Are there any msgid generated after makemessages? Or Django have some already localized strings?

Django already ships with translations. But not all languages have 100% of the messages translated.
A nice start would be to know which language are you noticing the missing the translations and what are the english messages that you’re receiving.

Sorry, again. I should’ve mentioned (don’t know why I didn’t do this, was in rush).

I wanted translation for Ukrainian language. (Now I understand, that it’s possible that Django doesn’t have it)

Ukrainian is rather well translated, but indeed some validation messages are not, so this is a possible explanation to your issue (e.g. you can see the 5.0 version of the core strings here: django/django/conf/locale/uk/LC_MESSAGES/django.po at stable/5.0.x · django/django · GitHub).

You may join the Ukrainian team on Transifex if you’d like to improve translation coverage for Django 5.1 (django localization | Transifex).

Hmm, it appears that message “This field is required.” is translated to Ukrainian.

I’ll make a test repository to reproduce this issue

I’m closing the issue. Thanks for the help!

It’s a silly mistake. It turns out the Ukrainian language is marked as uk, but not ua.

Glad you find the cause :face_with_hand_over_mouth: