-
Notifications
You must be signed in to change notification settings - Fork 149
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
Allow to translate errorr messages originating from colander schemas #200
Comments
I have this problem too. Colander documentation doesn't say much about this but my initial thought was that it was a Colander issue rather than a Cornice issue. |
@amarandon not exactly, this is just how colander works: https://github.com/Pylons/colander/blob/master/colander/__init__.py#L168 , however error translatable error messages are available another way, so cornice should use them instead Invalid.asdict() method probably. |
Having translated error messages would indeed be useful, As @amarandon pointed out, I think this is a colander issue, not a cornice issue, since cornice doesn't deal with translations. If the translation is done upstream, in the |
As for now, colander's (1.0b1) Invalid.asdict method which is used in schema._validate_fields Return a dictionary containing a basic (non-language-translated) error report for this exception, additionaly there's fixed string ""%s is missing"" in this function.
If colander itself provides translations, it'd be great to have this feature in cornice as well.
What i've found is:
https://groups.google.com/forum/#!topic/pylons-discuss/f10m24zyVeo
This solution involves probably monkey patching of colander's Invalid.asdict itself, so seems to be pretty ugly.
Any hint how to achive translated colander errorr strings in cornice?
The text was updated successfully, but these errors were encountered: