JSP CUSTOM TAG LIBRARIES


Creating localized message files
You can localize messages that display when an event is triggered, an error is thrown, or a validation error occurs by using a text editor to create a file that conforms to the standard Java properties file format. You retrieve these localized messages by referencing the bundle name of the .properties file in a tag's bundle attribute and referencing the entry name in the msgkey attribute. The default name for the bundle is messages.

To create a .properties file:

1. Format the file name as: <bundleName>_<languageCode>_<countryOrRegionCode>.properties. For example, you could format a standard US English output file as follows:


2. Include entries for the messages that are called by default. For example, you could name them as follows: 3. Place the .properties file in the following directory for your Java application:
Locale codes

The Accept-Language request-header field is used in the HTTP 1.1 protocol to restrict the set of natural languages that are preferred for use in formatting a response to an HTTP request. The value of the Accept-Language field is represented in the AcceptLang string of a user's browser. By default, the JSP container derives the locale value for its tags from the first locale specified in the AcceptLang string from the browser. However, you can override this default behavior by specifying the language and country/region codes explicitly as either a default JSP attribute (see Setting default JSP attribute values or by defining it per tag in the locale attribute of a single Domino tag (if the tag supports the locale attribute).

The following table provides some examples of the ISO-639 language codes and ISO-3166 country/region codes you can supply in the locale attribute of Domino JSP tags:
LanguageCountry or RegionLocale Code
Chinesezh
China (simplified Chinese)zh_CN
Taiwan (traditional Chinese)zh_TW
Englishen
Canadaen_CA
United Kingdomen_GB
United Statesen_US
Frenchfr
Canadafr_CA
Francefr_FR
Germande
Germanyde_DE
Italianit
Italyit_IT
Japaneseja
Japanja_JP
Koreanko
Koreako_KR
Spanishes
Spaines_ES
Venezuelaes_VE
For a full list of the ISO-639 language codes, see http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt and of the ISO-3166 country codes, see http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html. For more information on the HTTP 1.1 protocol, see http://www.w3.org/Protocols.

To specify that you want to display the formula tag body in Venezuelan Spanish, for example, write the formula tag as follows:

<tr><td>
<domino:formula format="raw" locale="es_VE">@Implode(@DocFields)"</td><td>")</domino:formula><br>
</td></tr>

See Also