0

I am using bootstrap validator to validate the forms in my spring boot web application. This application will be accessed in English and Marathi language.

In forms on validation error messages are shown in the English language. Is there any way we can show error messages in other languages depending on the language preference selected by the user?

ajm
  • 12,863
  • 58
  • 163
  • 234

1 Answers1

0

As shown in this thorough and this practical answer, the easiest way to do this is by adding a short javascript snippet to override the displayed text value

<input oninvalid="this.setCustomValidity('Replace this with your code for getting language specific strings. I am an error. Boo!')">

I'm not sure how the exact code would look like for spring, but this should give you a good enough idea.

Community
  • 1
  • 1
rusins
  • 309
  • 4
  • 8