Web UI Framework localization - localizing on the server side

Localizing on the server side involves the localization of field text and images that are referenced by the client side. Localizing on the client side involves user interface labels and other nonfield text.

About this task

For more information, refer to the Java™ API documentation in your installation directory.

Procedure

  1. Use tag libraries to specify the localized text and images that will be referenced from the server side.
  2. Register both default and custom localization providers in the web.xml file. Localization uses the LocalizationProvider class to implement the interface class ISCUILocalizationProvider. This interface class defines the basic standards for all localization behavior.
  3. Specify the localization provider in an instance of the interface class ISCUILocalizationProvider.

    The following shows an example of ISCUILocalizationProvider:

    package com.sterlingcommerce.ui.localization;
    public interface ISCUILocalizationProvider 
    {
      	public void init();
       public String getString(SCUIContext context, String message);
      	public String getDBString(SCUIContext context, String message);
      	public String getBundleFor(String name);
      	public void registerBundle(String bundleName);
    }

    To fetch localized strings from a table using the getDBString method, the calling JSP must include the following taglib:

    <%@ taglib uri="/WEB-INF/scui.tld" prefix="scuitag" %>

    This taglib is then called in the JSP as follows:

    <scuitag:i18nDB>test_string</ scuitag:i18nDB>

    Also, for the getDBString method to fetch localized strings from the table, the dblocalizable property in the entity XML files must be set to true.

    To fetch localized strings from resource bundles using the getString method, the calling JSP must include the following taglib:

    <%@ taglib uri="/WEB-INF/scui.tld" prefix="scuitag" %>

    This taglib is then called in the JSP as follows:

    <scuitag:i18n>test_string</ scuitag:i18n>
  4. To implement the customized Java code, build a jar file that contains the Java class, and then install the jar file using the install3rdparty.sh script. To implement this customization, rebuild the EAR or WAR file as you did during the installation, and then deploy the application on the application server.