How to Define the Base Resource Bundle

Internationalizing and Localizing Pages 21-11 Figure 21–4 Edit Resource Bundle Dialog

3. In the Select Resource Bundle dialog, select the file type from the File type

dropdown list. Navigate to the resource bundle you want to edit, as shown in Figure 21–5 . Click OK. Figure 21–5 Select Resource Bundle Dialog

4. In the Edit Resource Bundles dialog, click the Add icon to add a key-value pair, as

shown in Figure 21–6 . When you have finished, click OK. 21-12 Web User Interface Developers Guide for Oracle Application Development Framework Figure 21–6 Adding Values to a Resource Bundle

21.3.3 How to Register Locales and Resource Bundles in Your Application

You must register the locales and resource bundles used in your application in the faces-config.xml file. To register a locale for your application: 1. Open the faces-config.xml file and click the Overview tab in the editor window. The faces-config.xml file is located in the View_ ProjectWEB-INF directory.

2. In the editor window, select Application.

3. In the Locale Config area, click Add to open the Property Inspector to add the

code for the locale, as shown in Figure 21–7 . Internationalizing and Localizing Pages 21-13 Figure 21–7 Adding a Locale to faces-config.xml After you have added the locales, the faces-config.xml file should have code similar to the following: locale-config default-localeendefault-locale supported-localearsupported-locale supported-localecasupported-locale supported-localecssupported-locale supported-localedasupported-locale supported-localedesupported-locale supported-localezh_Chsupported-locale locale-config To register the resource bundle: 1. Open the faces-config.xml file and click the Overview tab in the editor window. The faces-config.xml file is located in the View_ ProjectWEB-INF directory.

2. In the editor window, select Application.

3. In the Resource Bundle section, click Add to enable editor input. Enter the fully

qualified name of the base bundle that contains messages to be used by the application and a variable name that can be used to reference the bundle in an EL expression, as shown in Figure 21–8 . Figure 21–8 Adding a Resource Bundle to faces-config.xml After you have added the resource bundle, the faces-config.xml file should have code similar to the following: resource-bundle base-nameoracle.fodemo.storefront.StoreFrontUIBundlebase-name varresvar