hilla icon indicating copy to clipboard operation
hilla copied to clipboard

Add message interpolation callback for custom server-side jakarta validations

Open taefi opened this issue 8 months ago • 0 comments

Describe your motivation

Having custom JSR380 validations on the backend, it would be handy if there was a way of intercepting to the message returned by the endpoint to translate it before presenting them to the user. The i18n of the messages for server-side validations can be handled at the backend as well, but having all the translations on the client-side makes it easier to maintain.

Describe the solution you'd like

A message interpolation callback that accepts the name of the failed validations, and any additional contextual parameters and values from the validation errors that can help with finding the translation, and filling out the message parameters.

Describe alternatives you've considered

No response

Additional context

No response

taefi avatar Dec 20 '23 16:12 taefi