When designing a Dynamo Web site for internationalization, you should move all text messages from your Java code to ResourceBundle.properties files and content pages. You can use ResourceBundle objects for any user messages that display in the Web site. It is often recommended that you use content pages instead of ResourceBundles to store session/request-scoped user messages. This is because content pages are more accessible to Web designers than ResourceBundles.

You can use the Switch servlet bean to generate user messages dynamically according to the event that has occurred. When an error event or any other event that generates a user message occurs, a parameter is set indicating that a message should be displayed. An additional parameter, which is the key, is set that indicates which message should be displayed. The Switch servlet bean generates the text contained within the <oparam></oparam> tags for a given key, and this is the text you translate for each locale in a multi-locale Web site.

You can then use any one of the methods described earlier in this chapter to determine the page that is appropriate for each user’s locale. For example, you can use the user profile’s locale property.

In the following JSP example, you translate the text that is shown in italics:

<dsp:oparam name="keyA">
Text to translate
</dsp:oparam>

For information on translating text within content pages, see Creating Locale-Specific Content Pages. For information on the Switch servlet bean, refer to the ATG Page Developer’s Guide.

 
loading table of contents...