From the course: Java EE: Bean Validation
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Internationalize failure messages
From the course: Java EE: Bean Validation
Internationalize failure messages
- [Instructor] Validation messages can be internationalized when using resource bundles. A resource bundle is just a folder which contains resources such as error messages. In the application, the resource bundle is usually located in the resources folder. This is a very typical way to organize resources required by the application at run time. In resources folder of the application, you will find a file named ValidationMessages.properties. This file must be called this way otherwise it will not be loaded by the Bean Validation API. This is the default file that is loaded when no other file is available. Files that contain translations for the default file are postfixed with the country code. So a Spanish language file is postfixed ES, and American English translation is postfixed US_en and so on. Note that the US English has a country then language part. This is useful when you have more than one dialect of the same language that is country-specific. So Canadian English will be CS_en…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.