O'Reilly logo

IBM Rational Application Developer V6 Portlet Application Development and Portal Tools by Ryan Wilson, Gianfranco Rutigliano, George Kroner, Belen Gonzalez, Karla Galvan, Cristiano Cesario, Juan R. Rodriguez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required