How to Configure a Page for an End User to Specify Locale

21-18 Web User Interface Developers Guide for Oracle Application Development Framework from the current locale, but you can override this default by specifying a value in this element. If set, this value is used by oracle.adf.view.faces.converter.NumberConverter while it parses and formats. ■ decimal-separator: Defines the separator used for the decimal point for example, a period or a comma. ADF Faces automatically derives the separator from the current locale, but you can override this default by specifying a value in this element. If set, this value is used by oracle.adf.view.faces.converter.NumberConverter while it parses and formats. ■ right-to-left: Defines the direction in which text appears in a page. ADF Faces automatically derives the rendering direction from the current locale, but you can explicitly set the default page rendering direction by using the values true or false. ■ time-zone: Defines the time zone appropriate to the selected locale. ADF Faces automatically uses the time zone used by the client browser. This value is used by oracle.adf.view.faces.converter.DateTimeConverter when it converts String to Date. ■ formatting-locale: Defines the date and number format appropriate to the selected locale. ADF Faces and Trinidad, will by default, format dates and numbers in the same locale used for localized text. If you want dates and numbers formatted in a different locale, you can use an IANA-formatted locale for example, ja, fr-CA. The contents of this element can also be an EL expression pointing at an IANA string or a java.util.Locale object.

21.5.1 How to Configure Optional Localization Properties

You can configure optional localization properties by entering elements in the trinidad-config.xml file. To configure optional localization properties: 1. Open the trinidad-config.xml file. The file is located in the View_ ProjectWEB-INF directory. 2. From the Component Palette, drag the element you wish to add to the file into the Structure window. An empty element is added to the page. 3. Enter the desired value. Example 21–11 shows a sample trinidad-config.xml file with all the optional localization elements set. Example 21–11 Configuring Currency Code and Separators for Numbers and Decimal Point -- Set the currency code to US dollars. -- currency-codeUSDcurrency-code -- Set the number grouping separator to period for German -- -- and comma for all other languages -- number-grouping-separator {view.locale.language==de ? . : ,} number-grouping-separator -- Set the decimal separator to comma for German -- -- and period for all other languages -- Internationalizing and Localizing Pages 21-19 decimal-separator {view.locale.language==de ? , : .} decimal-separator -- Render the page right-to-left for Arabic -- -- and left-to-right for all other languages -- right-to-left {view.locale.language==ar ? true : false} right-to-left formatting-locale {request.locale} formatting-locale -- Set the time zone to Pacific Daylight Savings Time -- time-zonePDTtime-zone