I’m doing a Web application using Spring 3.1.0.RELEASE, JSF 2.x, JPA 2 with Hibernate Provider. The application run on Tomcat 6.X.
The web-app can be show in different languages : en , es , fr.
I use the bean validation
@Size(max=20)
@NotBlank
I don’t understand why but every time I validate a form with an error to test the bean validation. The message display in english, but when i resubmit its display in the good lang.
In my page i set the lang like this:
<f:view locale="#{localeBackManager.currentLocale}" contentType="text/html">
My bundle display in the good lang. I have the same problem with the required messages.
What should I do to have the error message in same lang as the navigation lang at the first time ?
Thanks you.
Set the locale in the view was not sufficient:
You should set the locale in the code like this: