-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate form errors #10
Comments
Sounds like a nice feature. Regarding:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language
I'd vote for being thorough and using the "full" locale identifier. We've always been mixing |
I think the full locale is often used when you also want to set localisation stuff like date formats. I want to do some further investigation regarding corner cases; consider a date field; it might be nice to handle the date format in a different way for Dutch / English regions. |
@Mark90 This looks promising -> https://github.com/boardpack/pydantic-i18n That seems to have a way to acquire all pydantic2 error messages. |
@acidjunk Nice, I'm curious whether it can translate the "constant" part of the error message, so that we can generate static translation files for the pydantic-forms |
I needed translated (NL/Dutch)
FormValidation
errors in a frontend and tried to get that working. There is a package pydantic-translationsI am not sure about the best internationalisation project for pydantic; there's also pydantic-i18n
or (https://pypi.org/project/pydantic-errors-messages-translations/)[pydantic-errors-messages-translations]
With
pydantic-translations
: I managed to get Dutch / NL form validations errors in the frontend, by changing some code inpost_form()
:This works as a POC: it might be cool to add this as a feature, by adding an optional language parameter in start_form() and post_form().
Investigate:
The text was updated successfully, but these errors were encountered: