Search code examples
validationspring-mvchibernate-validator

Spring 3 Validation and internationalization


I use this link to config my project's validation: Spring 3 Validation

And I added the following dependency:

     <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>4.1.0.Final</version>
    </dependency>

It works fine,but I have a internationalization issue,I am using Chinese, but I found there is no zh_CN exists in hibernate-validator-4.1.0.Final.jar. Is there another option? Thanks.


Solution

  • Have you tried the latest beta release?

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>4.2.0.Beta1</version>
    </dependency>
    

    This link says that the Chinese translation work that has only just been finished in this version. There is a ValidationMessages_zh_CN.properties file inside the .jar so hopefully it contains what you need.