Localized field converters

Hi,

in Vaadin 7, TextFields have some predefined converters, e.g. an StringToIntegerConverter. But this validator always returns an englisch ConversationException, which is displayed to the user.
How do I implement localized error messages? Do I have to write a ConverterFactory and return my own, localized Converters there?

Thanks

Hi,

seems that the exceptions are hardcoded so yes, using a ConverterFactory seems to be the preferred option. However, you could just provide your own converter (field.setConverter(new StringToIntegerConverter(…))), override the convertToModel method, catch the possible exception and throw your own localized version. This might be a little bit less work than the factory.

-tepi