Internationalization
A JSF application can be internationalized with standard resource bundles (java.util.ResourceBundle
) and messages. Resource bundles are suitable to internationalize the text on the components, controls, and digital assets; whereas message files are meant to internationalize the JSF validation errors.
In a Gradle or Maven project, we will add a resource bundle or message file to the src/main/resources
project location with the necessary Java package as folders.
Resource bundles
We will configure the resource bundles in the Faces configuration file, /WEB-INF/faces-config.xml
, for the web application.
For the contact details application in Chapter 4, JSF Validation and AJAX, we have two resource bundle files in English and German: appMessages.properties
and appMessage_de.properties
respectively.
Here is the English language bundle:
// uk/co/xenonique/digital/appMessages.properties contactForm.firstName=First Name contactForm.lastName=Last Name contactForm.houseOrFlatNumber=House...