When I add custom validation errors with request.errors.add method (eg. request.errors.add('body', 'filed', _('Message')) ) then cornice will not translate description for me. This behavior is not consistent with colander schema validation where messages are translated automatically with request.localizer.translate method.
This PR adds support for auto translation so it will not be necessary to call translation directly while passing description parameter to request.errors.add.
When I add custom validation errors with
request.errors.add
method (eg.request.errors.add('body', 'filed', _('Message'))
) then cornice will not translate description for me. This behavior is not consistent with colander schema validation where messages are translated automatically withrequest.localizer.translate
method. This PR adds support for auto translation so it will not be necessary to call translation directly while passing description parameter torequest.errors.add
.