previous | index | next

Internationalizing With Message Bundles

You can change the language of a web application simply by exchanging the properties file.

Here are the strings for the number quiz application in German: messages_de.properties.

You can internationalize an application in the faces-config.xml file using the locale-config element within an application element:

   <application>
      <locale-config>
         <default-locale>en</default-locale>
         <supported-locale>de</supported-locale>
      </locale-config>
   </application>

Now if the browser is told to switch to German, the appropriate strings will be used.

Here is the full configuration file for the number quiz application: faces-config.xml.


previous | index | next