Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Change validation message language
I'm trying to change the language for the validation error messages in Vaadin, such as "Date is out of allowed range", but I haven't been able to accomplish this. I need to set this and other messages in Spanish. System messages can be overriden via getSystemMessages, but these ones cannot.
How can I do this without dying while trying?
In this picture I took a screenshot of my issue.
Thanks in advance.
At least DateField has #setDateOutOfRangeMessage and #setParseErrorMessage.
For validators there is usually a msg field in constructor. And if you do a custom Validator you can decide what message is thrown with InvalidValueException.
Note that you can also override many of the protected methods in DateField if you want some very specific functionality in your message.
Thanks, Johannes and Olli.
The setDateOutOfRangeMessage method didn't work. Here is a screenshot after using it.
The problem is that my application is being developed for spanish users, and I can't use the "Out of allowed range" message. I just need it to show that message in spanish.
I don't understand why setDateOutOfRangeMessage doesn't work.
Ok, now it works. I just cleaned up my browser history and it works fine.
Thanks again, both of you!