If you set up a separate product catalog for each language on the site, each product catalog is defined by an XML file. For example, the Pioneer Cycling site has a separate XML file for each of the three languages the site supports: frenchProductCatalog.xml
, japaneseProductCatalog.xml
, and a file productCatalog.xml
that represents the standard English product catalog. If you decide to set up multiple product catalogs, you must to create database tables that mirror the English product tables. For example, Dynamo’s primary English SKU table is named dcs_sku
. Pioneer Cycling uses equivalent tables for it’s French and Japanese SKUs named dfr_sku
and djp_sku
respectively. The first table is not re-used, despite the fact that all three tables have the same schema. All three tables contain matching data, the only difference is that the dfr_sku
and djp_sku
tables contain translated descriptions and prices that are specific to the French and Japanese locales.
To configure Dynamo to use multiple product catalogs, do the following:
Create a catalog repository XML file that defines the product catalog. For more information, see the Catalog Repository section of this chapter.
Create database tables that map to the catalog repository as described in the
productCatalog.xml
file.Copy the
productCatalog.xml
file and modify it as necessary for the other locales your site is supporting.You should rename this file so it is unique and recognizable for a certain locale. For example, you could rename the file
frenchProductCatalog.xml
.Create appropriately named database tables for each locale.
For example, the Pioneer Cycling application adds the letters of the locale to the name of each table. Note that multi-byte languages require multi-byte character columns to hold the translated Strings.
Populate the database tables with translated or otherwise locale-modified content. See Populating the International Catalogs with Product Data for more information.
Create a separate Control Center component for each product catalog. For example, the Pioneer Cycling demo uses three components,
ProductCatalog
,FrenchProductCatalog
, andJapaneseProductCatalog
. Make sure that thedefinitionFiles
property of each component points to the appropriate repository definition file. For example, theFrenchProductCatalog
component’sdefinitionFiles
property should point to the file at/atg/commerce/catalog/frenchProductCatalog.xml
.Configure the
alternateCatalogs
property of the/atg/commerce/catalog/CatalogTools
component.You can use the
CatalogTools
component to set up a relationship between multi-language repositories and their matching product catalogs. ThealternateCatalogs
property of theCatalogTools
component specifies a mapping between repository keys and alternative repositories. For example, you can specify that the keyfr_FR
attached to a JSP should pull content from the French Product Catalog. If you don’t provide this mapping, theCatalogTools
component reverts to the standard product catalog, even if the user’s request locale is not the same as the standard product catalog.Configure the
useDefaultRepository
andrepository
properties of the Nucleus component.Set the
useDefaultRepository
property totrue
if you want Dynamo to search the default repository when an item is not found in an alternate repository.Set the
repository
property to point to the default repository component.
For more information on how multiple product catalogs are set up in the Pioneer Cycling demo, see Adding Support for Multiple Locales in the Displaying and Accessing the Product Catalog chapter of the ATG Consumer Commerce Reference Application Guide.
Populating the International Catalogs with Product Data
When you want your site to have several duplicate catalogs, one for each language your site supports, you create the first language catalog, then create the second language catalog in one of the following ways:
Copy the original catalog in bulk, then, in the ACC, translate property values into the appropriate language.
Create catalog items manually in the ACC.
Before you replicate your catalog data, it is important to decide whether an item in multiple catalogs should use the same ID in each. Depending on how your site is configured, having the same ID for a given item across catalogs may provide the following advantages:
To populate a second language catalog, you copy the original in bulk, then translate property values into the appropriate catalog. You won’t need to replace the ID in copied catalog with an invented ID that’s unique and consistent with others.
Because an item has the same ID in all catalogs, a given item isn’t difficult to find, which makes it easier to maintain consistency and quality across catalogs.
JSPs can include hard-coded repository IDs because ATG Commerce uses the locale of a user’s browser to determine the appropriate language catalog’s items to display.
Promotions can apply to products from all catalogs.
If a JSP can’t display an item from the requested language catalog, you can display items in a default language catalog.
If the listed advantages are actually disadvantages for your site, because, for example, your JSPs include hard-coded repository IDs that must access items in a specific catalog, assign each item a unique ID.