Access to add and change pages is restricted. See: https://cwiki.apache.org/confluence/display/OFBIZ/Wiki+access

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

How to localize product's Name (same for descriptions)

This is handled through the alternate locale feature of the Content Manager. Each ProductContent will point to the content for the "default" locale, and that Content can have other contents associated with it as alternate locale contents. There are various reasons for this structure, but the main one is to be able to create a tree of defaults and to use a generic structure rather than one for each place Content is used in the system.
For clarification it goes like this:Product
-> ProductContent
-> Content -> DataResource
-> ContentAssoc (type: ALTERNATE_LOCALE)
-> Content -> DataResource
-> ContentAssoc (type: ALTERNATE_LOCALE)
-> Content -> DataResource
-> ContentAssoc (type: ALTERNATE_LOCALE)
-> Content -> DataResource
...

Step by step guide (for Product Name, same for descriptions):

  1. In Catalog Manager, go to the Edit product content tab.
  2. Clear the Product Name entry (respectively descriptions) in the "Override Simple Fields". When localizing, these fields must be empty. They have precedence over the localized product name content.
  3. Create a "Product Name content" (actually four entity values get created: ProductContent, Content, DataResource, ElectronicText) in your preferred locales.
  4. In the Content Manager create a new Content (type "Template") with a different locale and a DataResource (Type "Long Text") belonging to the new content, ie :
    1. create a new DataResource
    2. create a new Content with the dataResourceId set to the DataResource just created
  5. Associate the new content to the product content as "Alternate Locale"
  6. Goto the the content page for the content created in (3), click the Association tab, set the "contendId To" to the contentId created in (4b)

Now, in ecommerce, the product name (respectively descriptions) should be displayed in diffent locales depending on the browser settings.

An alternative (without UI) is to follow the content of DemoProductI18nData.xml, see also DemoProductCategoriesI18nData.xml

  • No labels