Legal | Privacy

Building a Global Application with the Globalization Development Kit (GDK)

In this lesson, you use the APIs in the Oracle Globalization Development Kit (GDK) to migrate an existing English-only monolingual J2EE application to a global multilingual application. The application contains a JSP front end to a simple customer order-retrieval application (Oracle  Store) based on the oe sample schema. The application contains servlets that use GDK to persist regular Java objects.

This lesson covers the following topics:

Overview
Prerequisites
Files in the Oracle Store Application

Installing the Oracle Store Application

Running the Current English-Only Oracle Store Application
Configuring and Setting Up the GDK Application
Adding Translated Store Logos
Integrating Translated UI Text

Formatting Dates and Numbers with Oracle Formatter Classes

Using Predefined Oracle Locale Translations
Detecting the User-Preferred Locale
Enabling Support for Exchange Rates, Translated Product Names, and Translated Descriptions
Using Oracle Linguistic Sorts
Displaying Flags and Available Language Translations
Adding Support for a New Locale (Germany)
Integrating Language Detection Technology

Place the cursor on this icon to display all the screenshots in the lesson. You can also place the cursor on each individual icon in the following steps to see only the screenshot that is associated with that step.

The Globalization Development Kit (GDK) for Java provides a J2EE application framework and Java APIs to develop globalized Internet applications using the best globalization practices and freatures designed by Oracle. The GDK complements the existing globalization features in Java by extending Oracle Globalization Support features to the application server. Globalization logic such as Oracle date/number/monetary formatting and Oracle binary and linguistic sorting are now available in the middle tier. The GDK provides mappings between Oracle and Java locales, enables character-set conversions between Oracle and Java character sets, and returns locale-related data sets (such as the common languages, linguistic sorts, and local time zones supported in a given region).  It offers APIs that can encapsulate the complexity of globalization programming such as locale determination and processing of the locale information. It supports the detection of the user-preferred locale and the rewriting of URLs to locate content for the different locales.The GDK provides a single application configuration file to control the globalization behavior of the user application.

Note: A locale refers to a national language and the region in which the language is spoken. For example, the primary language of the United States and Great Britain is English; however, the two countries have different currencies and different conventions for date formats. Therefore, the United States and Great Britain are considered to be two different locales.

Before starting this lesson, you should have:

1.

Completed the Configuring Linux for the Installation of Oracle Database 10g lesson

2.

Completed the Installing Oracle Database 10g on Linux lesson

3.

Completed the Installing Oracle9i JDeveloper on Linux lesson

4.

Downloaded and unzipped gdk.zip to your working directory
(/home/oracle/wkdir)

The application includes the following files: 

Java Source Files

src/oracle/i18n/demo/obe/gdkshop
AuthFilter.java Authentication filter
MyAccountAction.java My Account servlet
OrderInformationAction.java Order Information servlet
ShopAction.java Shop actions
src/oracle/i18n/demo/obe/gdkshop/bean
Customer.java Customer bean
Order.java Order bean
OrderItem.java Order item bean
src/oracle/i18n/demo/obe/gdkshop/gdk
DBLocaleSource.java Locale source for user schema in the database
Translations.java UI translations for English (to be added during the lesson)
Translations_de.java UI translations for German (to be added during the lesson)
Translations_es.java UI translations for Spanish (to be added during the lesson)
Translations _zh_cn.java UI translations for Simplified Chinese (to be added during the lesson)

JSP and Static Contents

public_html/
index.jsp Index JSP page
myaccount.jsp My Account JSP page
orderinformation.jsp Order Information JSP page
feedback.jsp A Feedback JSP page
store_logo_new.gif Shop logo image for English
US.gif Flag image for United States (to be added during the lesson)
CN.gif Flag image for China (to be added during the lesson)
DE.gif Flag image for Germany (to be added during the lesson)
ES.gif Flag image for Spain (to be added during the lesson)
IN.gif Flag image for India (to be added during the lesson)
public_html/de/
store_logo_new.gif German Oracle Shop logo (to be added during the lesson)
public_html/es/
store_logo_new.gif Spanish Oracle Shop logo (to be added during the lesson)
public_html/zh_cn/
store_logo_new.gif Simplified Chinese Oracle Shop logo (to be added during the lesson)
public_html/WEB-INF/
web.xml Web deployment descriptor
gdkapp.xml GDK/OGS application configuration file (to be added during the lesson)
public_html/WEB-INF/lib/
orai18n-lcsd.jar GDK LCSD (language and character set detection) extension (to be added during the lesson)
orai18n.jar GDK main library (to be added during the lesson)

To populate the sample schema with new sample data, perform the following steps:

1.

Unzip gdk.zip to your working directory (/home/oracle/wkdir).

 

2.

Create tables for storing currency exchange rates and time zone information. Open a terminal window and execute the following:

cd /home/oracle/wkdir/gdk/step0
sqlplus oe/oe
@obeGdkSetup

Note: obeGdkSetup.sql is a script file that populates tables such as CUSTOMERS, ORDERS, and ORDER_ITEMS of OE schema. This directory also contains the obeGdkRevert.sql script, which uninstalls all the objects that are created for this lesson.

Move your mouse over this icon to see the image

 

You now run Oracle Store as an English-only (monolingual) application and observe its behavior. In the next exercise, you will change the source files to make it a multilingual application.

Note: The modified files are already provided and you are not expected to make changes to the source files. However, the changes that have been made to the files are explicitly described.

To run the monolingual application, perform the following steps:

1.

Launch Oracle9i JDeveloper.

 

2.

Set Mozilla as the default browser in JDeveloper.
Tools > Preferences > Web Browser/Proxy. Enter /usr/bin/mozilla -remote openURL(${URL}) || /usr/bin/mozilla ${URL} in the Browser Command Line field.

Move your mouse over this icon to see the image

 

3.

Click and highlight Workspaces in the System-Navigator window. Click the + icon at the top-left corner to Add to Workspaces.

Move your mouse over this icon to see the image

 

4.

Select the following file, and then click Open:
/home/oracle/wkdir/gdk/obe_gdk.jws

Note: Click Yes if you are asked if you want to migrate these files.

Move your mouse over this icon to see the image

 

5.

Expand the tree to ensure that the project gdkshop.jpr is included.

Move your mouse over this icon to see the image

 

6.

You must verify the JDBC database connect string. Expand the project tree below gdkshop.jpr. Right-click web.xml and select Open.

Move your mouse over this icon to see the image

 

7.

You should see the following information:

<context-param>
  <param-name>gdkdemo.jdbccon</param-name>
  <param-value>jdbc:oracle:thin:@localhost:1521:orcl</param-value>
</context-param> 

This currently connects to a database on your local machine with SID = orcl  using the port number 1521. Replace with your connect string if necessary, and then save the file.

Move your mouse over this icon to see the image

 

8.

Click and highlight the project gdkshop.jpr.
Select Run > Run gdkshop.jpr.

Note: You may have to open a browser instance to view the application

Move your mouse over this icon to see the image

 

9.

The first page is the login screen for the Oracle Store application. The drop-down list shows the available customers and their country of residence. Click the Submit button to view the account profile and the order history of the selected customer.  

Move your mouse over this icon to see the image

 

10.

View the customer details. Observe that the date is displayed in the upper-right corner of the browser. Click Back.

Move your mouse over this icon to see the image

 

11.

Check the details of another customer, Daniel Zhang. Select Daniel Zhang from the drop-down list, and then click Submit.

Move your mouse over this icon to see the image

 

12.

Note that Daniel's territory preference is China, but because this application has not been globalized, all the text is displayed in English. The credit limit is based on U.S. dollars; the date and time stamp of the order is based on the database time stamp and not the customer's time zone. Dates retrieved from the database are formatted using Oracle date conventions, while the date generated for the application is formatted based on Java conventions. Click the order link to view the details of the order.

Move your mouse over this icon to see the image

 

13.

As on the previous page, all the text (including product names and descriptions) is in English only; the monetary values are formatted using U.S. currency conventions based on U.S. dollars and U.S. debit symbols. The items are ordered based on the binary values of the English-language product names. Click the Oracle Store logo to return to the customer login page.

Move your mouse over this icon to see the image

 

You now migrate from a monolingual Oracle Store to a global multilingual Oracle Store. You add support for the following languages: Simplified Chinese, Spanish, and English. These languages serve Oracle Store customers in China, Spain, and India, respectively.

Notes:

  • You do not need to type the code changes into the existing application. Instead, all the updates are already prepared and shipped with the .zip file to demonstrate the multilingual Oracle Store application.
  • Some language characters may not be supported in certain browsers. We recommend that you use Internet Explorer 6.0 (or later versions) for this lesson.

Perform the following steps:

1.

Open a terminal window and execute the following commands:

cd /home/oracle/wkdir/gdk/gdkshop/public_html/WEB-INF
mkdir lib
cd lib
cp /home/oracle/wkdir/gdk/step1/lib/orai18n.jar orai18n.jar
cp /home/oracle/wkdir/gdk/step1/lib/orai18n-lcsd.jar orai18n-lcsd.jar
cd ..
cp /home/oracle/wkdir/gdk/step1/web.xml web.xml

In JDeveloper, right-click the gdkshop.jpr project and select Project Properties. Click Path and Edit Additional Class Path. Then click Add Entry and add the following paths:

/home/oracle/wkdir/gdk/gdkshop/public_html/WEB-INF/lib/orai18n.jar
and 
/home/oracle/wkdir/gdk/gdkshop/public_html/WEB-INF/lib/orai18n-lcsd.jar
Click OK
 
2.

Execute the following commands from your terminal window:

cd /home/oracle/wkdir/gdk/gdkshop/public_html/WEB-INF
cp /home/oracle/wkdir/gdk/step1/gdkapp.xml gdkapp.xml

The contents of the file include the following:

<?xml version="1.0" encoding="utf-8"?>
<gdkapp
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="gdkapp.xsd">
<!-- Application Configurations -->
<page-charset default="yes">UTF-8</page-charset>
<application-locales>
<locale default="yes">en</locale>
<locale>es</locale>
<locale>zh_CN</locale>
<locale>en_IN</locale>
</application-locales>
<locale-determine-rule>
<locale-source>oracle.i18n.servlet.localesource.HttpAcceptLanguage</locale-source>
</locale-determine-rule>
<!-- URL rewriting rule -->
<url-rewrite-rule fallback="yes">
<pattern>(.*)/([^/]+)$</pattern>
<result>$1/$A/$2</result>
</url-rewrite-rule>
</gdkapp>

This is the GDK application configuration file, which controls the globalization behavior of the Oracle Store application. One application configuration file is required for each J2EE application that uses the GDK.

Supports English (en) as the default application locale. Spanish (es), Simplified Chinese
in China (zh_CN), and English in India (en_IN) are also supported.
Uses the browser language preference (HTTP Accept-Language header)  to
determine the user locale
Rewrites URLs to redirect translated contents based on the user locale

 

You can have different logos for each language. To add the Oracle Store logos, perform the following steps:

1.

In your terminal window, execute the following commands:

cd /home/oracle/wkdir/gdk/gdkshop/public_html
mkdir es
cd es
cp /home/oracle/wkdir/gdk/step2/es/store_logo_new.gif store_logo_new.gif
cd ..
mkdir zh_CN
cd zh_CN
cp /home/oracle/wkdir/gdk/step2/zh_CN/store_logo_new.gif store_logo_new.gif

The directories es and zh_CN store the Oracle Store logos for Spanish and Chinese, respectively.

 

2.

Copy the index.jsp, myaccount.jsp, and orderinformation.jsp files to the appropriate directories. In your terminal window, execute the following:

cd ..
cp /home/oracle/wkdir/gdk/step2/index.jsp index.jsp
cp /home/oracle/wkdir/gdk/step2/myaccount.jsp myaccount.jsp
cp /home/oracle/wkdir/gdk/step2/orderinformation.jsp orderinformation.jsp
cp /home/oracle/wkdir/gdk/step2/feedback.jsp feedback.jsp

Note: This folder already contains these three files, which were used for the monolingual application. Overwrite the old files with the modified ones.

Open each file and observe that the classes in the servlet and util packages are imported as follows:

<%@ page import="oracle.i18n.servlet.*, oracle.i18n.util.*" %>        

The Oracle Store logo file name in the JSP files is changed from store_logo_new.gif to the following:

<%= ServletHelper.rewriteURL("./store_logo_new.gif", request) %>

 

3.

You are now ready to run the application in JDeveloper. First you need to make sure the OC4J server has been terminated. Select Run > Terminate > Embedded OC4J Server.

Move your mouse over this icon to see the image

 

4.

Rebuild the project gdkshop.jpr. Select Project > Rebuild gdkshop.jpr.

Move your mouse over this icon to see the image

 

5.

Select Run > Run gdkshop.jpr.

Move your mouse over this icon to see the image

 

6.

If you see the Oracle Store logo in English (as displayed in the accompanying screenshot), you should set the language preference of your browser.

Move your mouse over this icon to see the image

 

7.

The steps in this lesson assume that you are using a Mozilla browser. Select Edit > Preferences. Then select Languages under Navigator. Click the Add button.

Move your mouse over this icon to see the image

 

8.

Enter es in the Others field, and then click OK.

Move your mouse over this icon to see the image

 

9.

Notice that Spanish has been added to the list. Click the Add button again to add Chinese.

Move your mouse over this icon to see the image

 

10.

Enter zh-CN in the Others field, and then click OK.

Move your mouse over this icon to see the image

 

11.

Select Spanish in the list and click the Move Up button until Spanish appears at the top of the list. Then click OK..

Move your mouse over this icon to see the image

 

12.

Switch back to your Web page and refresh the screen. You now see that the Spanish-language logo is displayed. Make sure that this is reflected on all three JSP pages.

Move your mouse over this icon to see the image

To translate the application into different languages, all hard-coded text strings should be externalized to resource files. These files can then be sent for translation. The resource bundle is Java's primary mechanism for localizing applications.

To externalize all UI text from the three JSP files into Java resource bundles, perform the following steps: 

1.

You need to copy the three translation files to your project directory. In your terminal window, execute the following commands:

cd /home/oracle/wkdir/gdk/gdkshop/src/oracle/i18n/demo/obe/gdkshop
mkdir gdk 
cd gdk 
cp /home/oracle/wkdir/gdk/step3/Translations.java Translations.java
cp /home/oracle/wkdir/gdk/step3/Translations_es.java Translations_es.java
cp /home/oracle/wkdir/gdk/step3/Translations_zh_CN.java Translations_zh_CN.java

The contents of the Spanish translation file, Translations_es.java, are as follows:

package oracle.i18n.demo.obe.gdkshop.gdk;
import java.util.ListResourceBundle;
public class Translations_es extends ListResourceBundle
{
static final Object[][] contents =
{
{ "RETURNING_CUSTOMERS", "Clientes que vuelven..." },
{ "SUBMIT", "Env\u00ede" },
{ "MY_ACCOUNT", "Mi cuenta " },
{ "ACCOUNT_PROFILE", "Infomaci\u00f3n de cuenta" },
{ "FIRST_NAME", "Nombre" },
{ "LAST_NAME", "Apellido" },
{ "EMAIL", "Correo electr\u00f3nico" },
{ "LANGUAGE", "Idioma" },
{ "TERRITORY", "Territorio" },
{ "REGISTERED_DATE", "Fecha de registraci\u00f3n" },
{ "CREDIT_LIMIT", "Limite de credito" },
{ "ORDER_TRACKING_AND_HISTORY", "Seguimiento del pedido e historial" },
{ "GRAND_TOTAL", "El gran total" },
{ "TOTAL", "Total" },
{ "DISCOUNT", "Descuento" },
{ "PRODUCT_NAME", "Nombre del producto" },
{ "PRODUCT_DESCRIPTION", "Descripci\u00f3n del producto" },
{ "ITEM_NUMBER", "N\u00famero de parte" },
{ "QUANTITY", "Cantidad" },
{ "SUB_TOTAL", "Subtotal" },
{ "ORDER_INFORMATION", "Informaci\u00f3n de orden" },
{ "ORDER_NUMBER", "N\u00famero de orden" },
{ "ORDER_DATE", "Fecha de orden" },
{ "YOUR_ORDER_PLACED", "Su orden procesada {0}" },
{ "FEEDBACK", "Comentarios" },
{ "YOUR_MESSAGE", "Su comentario ha sido enviado" }
};
public Object[][] getContents()
{
return contents;
}
}

 

2.

To register the Translations class, execute the following commands in the terminal window:

cd /home/oracle/wkdir/gdk/gdkshop/public_html/WEB-INF
cp /home/oracle/wkdir/gdk/step3/gdkapp.xml gdkapp.xml

Review the contents of the file to see the details of the <message-bundles> tag:

<message-bundles>
  <resource-bundle name="default">oracle.i18n.demo.obe.gdkshop.gdk.Translations
  </resource-bundle>
</message-bundles>

3.

The code that is required to handle translation has been added to your JSP files. In the terminal window, execute the following commands:

cd .. (Note: you want to be in the /home/oracle/wkdir/gdk/gdkshop/public_html directory)
cp /home/oracle/wkdir/gdk/step3/index.jsp index.jsp
cp /home/oracle/wkdir/gdk/step3/myaccount.jsp myaccount.jsp
cp /home/oracle/wkdir/gdk/step3/orderinformation.jsp orderinformation.jsp
cp /home/oracle/wkdir/gdk/step3/feedback.jsp feedback.jsp

Review the contents of each file to see that the Localizer object is instantiated at the top of each JSP page by adding the following:

<% Localizer localizer = ServletHelper.getLocalizerInstance(request); %> 

In addition, all translatable texts are replaced with the localizer.getMessage API call. For example, "Returning Customers..." is replaced with the following:

<%= localizer.getMessage("RETURNING_CUSTOMERS") %>


4.

The code that is required to handle translation has been added to your Java files. In the terminal window, execute the following commands:

cd /home/oracle/wkdir/gdk/gdkshop/src/oracle/i18n/demo/obe/gdkshop
cp /home/oracle/wkdir/gdk/step3/MyAccountAction.java MyAccountAction.java
cp /home/oracle/wkdir/gdk/step3/OrderInformationAction.java 
    OrderInformationAction.java

Review the contents of each file to see that the Localizer object is instantiated with the following:

<% Localizer localizer = ServletHelper.getLocalizerInstance (request); %> 

In addition, all translatable texts are replaced with the localizer.getMessage API call. For example, "Returning Customers..." is replaced with the following:

import oracle.i18n.servlet.ServletHelper; 
import oracle.i18n.servlet.Localizer; Localizer localizer = ServletHelper.getLocalizerInstance(request); request.setAttribute("localizer",localizer);

 

5.

Before the application can pick up the Spanish and Simplified Chinese translation files, the resource bundles must be included in the project. In JDeveloper, click and highlight gdkshop.jpr in the System-Navigator window. Click the + icon at the top-left corner.

 

6.

Select and open the directory home/oracle/wkdir/gdk/gdkshop/src. Select Java Source
(*.java)
from the "File type" list. Click Open.

Move your mouse over this icon to see the image

 

7.

Click OK.

Move your mouse over this icon to see the image

 

8.

You are now ready to rerun the application. Terminate the Embedded OC4J Server, Rebuild gdkshop.jpr and Run gdkshop.jpr.

 

9.

You see that the field and button labels on this page are now translated into Spanish. Click the Envie button.

Move your mouse over this icon to see the image

 

10.

You see that the labels and links on this page are translated into Spanish.

Move your mouse over this icon to see the image

 

To format dates and numbers (and see the impact on the application), perform the following steps:

1.

Changes have been made to format the dates and numbers in the application. In the terminal window, execute the following commands:

cd /home/oracle/wkdir/gdk/gdkshop/public_html
cp /home/oracle/wkdir/gdk/step4/myaccount.jsp myaccount.jsp
cp /home/oracle/wkdir/gdk/step4/orderinformation.jsp orderinformation.jsp
cp /home/oracle/wkdir/gdk/step4/feedback.jsp feedback.jsp

The following date formatting is used:

<%= localizer.formatDateTime(new Date(), DateFormat.LONG) %>
<%= localizer.formatDate(customer.registeredDate,DateFormat.SHORT)%>
<%= localizer.formatDateTime(order.orderDate,DateFormat.LONG)%>

The following currency formatting is used:

<%= localizer.formatCurrency(customer.creditLimit) %>  

The following message formatting is used to format complex UI text with translations:

<%=
  new MessageFormat(localizer.getMessage("YOUR_ORDER_PLACED")).
  format(new Object[] {localizer.formatDateTime(o.orderDate, 
DateFormat.LONG)}) %>

2.

You want to change the language in your browser to English. Select Edit > Preferences. Under Navigator, select Languages. Select English/United States and click Move Up. Then select English and click Move Up. Then click OK.

Move your mouse over this icon to see the image

 

3.

You are now ready to rerun the application. Terminate the Embedded OC4J Server, Rebuild gdkshop.jpr and Run gdkshop.jpr.

 

4. Click Submit.

Move your mouse over this icon to see the image

 

5. You see that all the dates, numbers, and currencies now have a consistent format based on Oracle globalization conventions.

Move your mouse over this icon to see the image

 

6. Change the language to Chinese to see how the date and currency change.

Move your mouse over this icon to see the image

 

7. The language is now Chinese. Click the submit button.

Move your mouse over this icon to see the image

 

8. You see that all date and currency formatting has been changed to Chinese.

Move your mouse over this icon to see the image

Because the localizer is dependent on the language setting in the browser, the time stamp is also being converted from the database time zone to the default time zone defined by the browser locale. The problem with this approach is that for countries with more than one time zone, the converted time stamp may not accurately reflect the local time of the customer. See Detecting the User-Preferred Locale for information on resolving this issue.

In addition, the currency is now changed to reflect the local currency. However, because the exchange rates are never static and do vary between currencies, it is not possible for the localizer to recalculate the new values automatically. See
Enabling Support for Exchange Rates, Translated Product Names, and Translated Descriptions for information on resolving this issue.

 

Using Predefined Oracle Locale Translations    

The translations of names for all Oracle-supported territories, languages, linguistic sorts, time zones, currencies, and character sets are available in the GDK. These can be used directly inside the application by calling the appropriate classes. To use the predefined Oracle locale translations, the following changes are made:

1.

Changes have been made to myaccount.jsp for the translations of names. In the terminal window, execute the following commands:

cd /home/oracle/wkdir/gdk/gdkshop/public_html
cp /home/oracle/wkdir/gdk/step5/myaccount.jsp myaccount.jsp

The territory in the account profile is changed to the appropriate translated name:

<%= localizer.getDisplayTerritory(customer.nlsTerritory)%>

The language name is changed to the appropriate translated language name:

<%= 
  localizer.getDisplayLanguage
  (LocaleMapper.getOraLanguageFromShortName(customer.nlsLanguage))
%>  

The language ID stored in the OE.CUSTOMER table uses the Oracle short language name. To get the full translation name, call LocaleMapper.getOraLanguageFromShortName.

 

2.

You are now ready to rerun the application. Terminate the Embedded OC4J Server, Rebuild gdkshop.jpr and Run gdkshop.jpr.

 

3. When the first page appears, click Submit. Note that the language and the territory names on the Account Profile page are now translated into the language set in your  browser.

Move your mouse over this icon to see the image

 

Detecting the User-Preferred Locale

A customer's account profile already contains that customer's language and territory information. This information can be used to establish the preferred locale after the customer logs in to the application. A table storing the customers' time zone information was created by the OBE setup script obeGdkSetup.sql. This information is used to convert from the system time stored in the database to the user's current time zone.

 

SQL> desc ext_user_profile
         
 Name                                      Type
 ----------------------------------------- -----------------------
 CUSTOMER_ID                               NUMBER(6)
 TIMEZONE                                  VARCHAR2(50)
 REG_DATE                                  DATE
         
SQL> select * from ext_user_profile;
           
 CUSTOMER_ID TIMEZONE                                           REG_DATE
 ----------- -------------------------------------------------- ---------
        9000 America/Los_Angeles                                30-SEP-02
        9001 Europe/Madrid                                      05-MAR-01
        9002 Asia/Shanghai                                      12-JUN-99
        9003 Asia/Calcutta                                      23-NOV-00
        9004 Europe/Berlin                                      20-NOV-02
       

 

Perform the following steps:

1.

A DBLocaleSource is created that will retrieve the user's locale preference stored in the OE.CUSTOMER table, and the user's time zone in  OE.EXT_USER_PROFILE. In the terminal window, execute the following commands:

cd /home/oracle/wkdir/gdk/gdkshop/src/oracle/i18n/demo/obe/gdkshop/gdk
cp /home/oracle/wkdir/gdk/step6/DBLocaleSource.java DBLocaleSource.java

 

2.

To register the locale source class in the GDK configuration file, a change has been made to gdkapp.xml. In the terminal window, execute the following commands:

cd /home/oracle/wkdir/gdk/gdkshop/public_html/WEB-INF
cp /home/oracle/wkdir/gdk/step6/gdkapp.xml gdkapp.xml

One line was added (in bold) to the gdkapp.xml file.

<locale-determine-rule>
    <locale-source>oracle.i18n.demo.obe.gdkshop.gdk.DBLocaleSource
</locale-source>
  <locale-source>oracle.i18n.servlet.localesource.HttpAcceptLanguage
</locale-source> </locale-determine-rule>

 

3.

Before the application can pick up the Spanish and Simplified Chinese translation files, the resource bundles need to be included into the project. In JDeveloper, click and highlight gdkshop.jpr in the System-Navigator window. Click the + icon at the top-left corner.

 

4.

Before the application can pick up DBLocaleSource.java, the file needs to be included in the JDeveloper project. Select and open the directory home/oracle/wkdir/gdk/gdkshop/src. Select Java Source
(*.java)
from the "File type" list. Click Open.

Move your mouse over this icon to see the image

 

5.

Click OK.

Move your mouse over this icon to see the image