12.1. Resource bundles
A resource bundle is a simple text file that contains key-value pairs. The key is used by a Java class to retrieve a locale-specific value. To provide support for a new locale, you need only create a new resource bundle with the same key names and translated values.
Example 12-1 demonstrates a base resource bundle. Example 12-2 demonstrates the resource bundle translated for Spanish. Notice the key names do not change, only the value is translated.
Example 12-1. NLSLab.properties resource bundle
welcome = hello goodbye = goodbye message = This is the NLSExample portlet |
Example 12-2. NLSLab_es.propert ies resource bundle
welcome = hola goodbye = adiós message = éste es el portlet NLSExample |
The file name of the resource ...
Get IBM Rational Application Developer V6 Portlet Application Development and Portal Tools now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.