21 Localizing Portals

This chapter describes how to configure your application to display text in the correct language of a user's browser.

This chapter includes the following topics:

21.1 Guidelines for Building Multilanguage Portals

If your application will be viewed by users in multiple countries, you can configure your JSF page or application to use different locales so that it displays the correct language for the language setting of a user's browser. For example, if you know your page will be viewed in Italy, you can localize your page so that when a user's browser is set to use the Italian language, text strings in the browser page appear in Italian.

Additionally, locale selection applies special formatting considerations applicable to the selected locale. For example, whether information is typically viewed from left to right or right to left, how numbers are depicted (such as monetary information), and the like.

When you develop a multi-language portal:

  • Make use of the inherent multi-language support in Oracle WebCenter Portal tools and services. For more information, see Language Support in ADF Faces Components.

  • Put all resources in resource bundles, provide alternate-language resource bundles, and code your application to respond to users' language selection. For more information, see Using Resource Bundles to Support Multiple Languages.

  • Make sure your database character set supports all required languages.

    For more information, see Choosing a Character Set in Oracle Database Globalization Support Guide.

  • Use number, date, and time formatting that supports all required locales.

    For more information, see Setting Up a Globalization Support Environment in Oracle Database Globalization Support Guide.

  • Use linguistic sort parameters to get the correct sort ordering for locale.

    For example, the same characters have different sort ordering in French and Canadian-French.

    For more information, see Linguistic Sorting and Matching in Oracle Database Globalization Support Guide.

  • Write web pages that correctly render left to right or right to left (for example, if Arabic languages must be supported).

For more guidelines on globalization, see Internationalizing and Localizing Pages in Developing Web User Interfaces with Oracle ADF Faces or refer to Oracle Database Globalization Support Guide.

21.2 Language Support in ADF Faces Components

Some ADF Faces components include text that is part of the component, for example the af:table component uses the resource string af_table.LABEL_FETCHING for the message text that is displayed in the browser while the table is fetching data during the initial load of data or while the table is being scrolled. Oracle JDeveloper provides translations of these text resources into 28 languages. Therefore, when using the supplied components, you do not need to perform additional steps to translate the text in the components.

21.3 Using Resource Bundles to Support Multiple Languages

For any text you add to a component, for example if you define the label of an af:commandButton component by setting the text attribute, you must provide a resource bundle that holds the actual text, create a version of the resource bundle for each locale, and add a <locale-config> element to define default and support locales in the application's faces-config.xml file. You must also add a <resource-bundle> element to your application's faces-config.xml file to make the resource bundles available to all the pages in your application. Once you have configured and registered a resource bundle, the Expression Language (EL) editor displays the key from the bundle, making it easier to reference the bundle in application pages.

To simplify the process of creating text resources for text you add to ADF components, JDeveloper supports automatic resource bundle synchronization for any translatable string in the visual editor. When you edit components directly in the visual editor or in the Property Inspector, text resources are automatically created in the base resource bundle.

For more information about automatic resource bundles, see Using Automatic Resource Bundle Integration in JDeveloper in Developing Web User Interfaces with Oracle ADF Faces.

For more information about manually defining resource bundles, see Manually Defining Resource Bundles and Locales in Developing Web User Interfaces with Oracle ADF Faces.

21.4 Adding Support for a New Language

Oracle WebCenter Portal provides run-time translations for 28 languages and 100 different locales. If you want to support a language that is not supported out-of-the-box, you need to provide string files for the new language, and add a <language> tag for the new language in the supported-languages.xml configuration file.

For information about adding support for a new language, see the "Using WebCenter Spaces Extension Samples" white paper on the Oracle WebCenter Portal White Papers and Technical Notes page on Oracle Technology Network.