C H A P T E R 4 |
Localizing Interfaces |
In addition to changing the look and feel of the Sun Java System Content Delivery Server interfaces, you can also change the language in which the pages are presented. The text strings used by the interfaces are in property files that you can edit to translate the strings to the language of your choice.
This chapter presents the following topics:
The Subscriber Portal is presented to subscribers in the language that is set for the browser that they are using. If Content Delivery Server does not support the language, the Subscriber Portal is presented in the language that is specified in the subscriber’s profile. You can set the default language for new profiles and customize the strings and images as needed.
By default, the Subscriber Portal is presented in English. You can change the default language to any locale supported by the Catalog Manager. See the online help for the Manage Server Locales page in the Catalog Manager administration console for information on adding locales.
To set the default locale for all Content Delivery Server interfaces, set the i18n.default.locale property in the $CDS_HOME/deployment/deployment-name/conf/CDS.properties file. To change the locale for only the Subscriber Portal, add the i18n.default.locale property to the $CDS_HOME/deployment/deployment-name/conf/SubscriberPortal.properties file. For example, the following statement sets the default language to French:
i18n.default.locale=fr
After you set the default language, you must restart the server.
The text strings used for the Subscriber Portal are defined in the SubscriberPortalLocaleResource.properties file and the FulfillmentLocaleResource.properties file in the $CDS_HOME/deployment/deployment-name/localization directory. Note that elements that are entered by an administrator, such as category names and prices, appear as they are entered, regardless of the locale specified.
To change the strings presented or customize the language, follow these steps:
1. Either edit the existing file, or copy the appropriate resource file to a new file. If you are creating a file for a different language, append the language code to the name of the file.
For example, to present the Subscriber Portal in Spanish, create a file named SubscriberPortalLocaleResource_es.properties.
2. Translate the text strings to the right of the equals sign (=). Do not change any strings to the left of the equals sign and do not delete an existing string.
Changes take effect when the file is saved.
In addition to changing the text for the Subscriber Portal, you can also provide language-specific page templates and images for the PC-based version.
For each locale that you need to support, you need a language-specific version of the SubscriberPortalLocaleResource.properties and FulfillmentLocaleResource.properties files in the $CDS_HOME/deployment/deployment-name/localization directory. For example, to support French you need files named SubscriberPortalLocaleResource_fr.properties and FulfillmentLocaleResource_fr.properties.
Set the following properties in each language-specific SubscriberPortalLocaleResource.properties file.
Source files for the Subscriber Portal are found in the following directory:
deployment-name is the name specified when the Vending Manager was deployed. server-domain is the domain name specified in the deployment configuration file for the app.server.domain property.
Create the subdirectories for the templates and images that you specified in the SubscriberPortalLocaleResource.properties files. For example, to support English and French, you might create the following directory structure:
In each template subdirectory, include a localized copy of the template file _tpl_main.jsp.
In each image subdirectory, include a copy of all localized images referenced by the Subscriber Portal. Leave images that are not specific to a language in the /static/media root directory. Files that contain the images for the buttons in the Subscriber Portal are described in Section 1.6, Changing Buttons.
In the template files, use the image path variable <%=img_url%> for images in the root image directory. Use the image path variable <%=localized_image_url%> for images in a language-specific subdirectory. The following code example shows the path for an image that is localized.
The following steps describe the process for presenting the Developer Portal in a different language.
1. In the $CDS_HOME/deployment/deployment-name/conf/CDS.properties file, set the i18n.default.locale property to the locale that you want to use.
This property determines the default locale for the Developer Portal, the Catalog Manager administration console, the Vending Manager administration console, the Subscriber Portal, and log files. To change the locale for only the Developer Portal, add the i18n.default.locale property to the $CDS_HOME/deployment/deployment-name/conf/DeveloperPortal.properties file.
2. In the $CDS_HOME/deployment/deployment-name/localization directory, make a copy of the file DevPortalMessages.properties with the language code appended to the end of the file name.
For example, to present the Developer Portal in Spanish, create a file named DevPortalMessages_es.properties.
3. In the file that you created, translate the text strings to the right of the equals sign (=) using the following guidelines.
The following steps describe the process for presenting the Catalog Manager administration console in a different language.
1. In the $CDS_HOME/deployment/deployment-name/conf/CDS.properties file, set the i18n.default.locale property to the locale that you want to use.
This property determines the default locale for the Developer Portal, the Catalog Manager administration console, the Vending Manager administration console, the Subscriber Portal, and log files. To change the locale for only the Catalog Manager administration console, add the i18n.default.locale property to the $CDS_HOME/deployment/deployment-name/conf/AdminConsole.properties file.
2. In the $CDS_HOME/deployment/deployment-name/localization directory, make a copy of the file AdminConsoleMessages.properties with the language code appended to the end of the file name.
For example, to present the administration console in Spanish, create a file named AdminConsoleMessages_es.properties.
3. In the file that you created, translate the strings to the right of the equals sign (=) using the following guidelines.
The following steps describe the process for presenting the Vending Manager administration console in a different language.
1. In the $CDS_HOME/deployment/deployment-name/conf/CDS.properties file, set the i18n.default.locale property to the locale that you want to use.
This property determines the default locale for the Developer Portal, the Catalog Manager administration console, the Vending Manager administration console, the Subscriber Portal, and log files. To change the locale for only the Vending Manager administration console, add the i18n.default.locale property to the $CDS_HOME/deployment/deployment-name/conf/VSAdminConsole.properties file.
2. In the $CDS_HOME/deployment/deployment-name/localization directory, make a copy of the file VendingManagerMessages.properties with the language code appended to the end of the file name.
For example, to present the administration console in Spanish, create a file named VendingManagerMessages_es.properties.
3. In the file that you created, translate the strings to the right of the equals sign (=) using the following guidelines.
See Section 12.1, “Set the Currency Symbol,” in the Sun Java System Content Delivery Server Integration and Configuration Guide for information on setting the currency symbol used by all components in a deployment.
Copyright © 2008, Sun Microsystems, Inc. All Rights Reserved.