Localize dynamic content items

To localize dynamic content items, you set the required culture by passing it as a parameter to the Lstring properties of the item.

In the following code example, you localize a dynamic content item that you created using the Dynamic Module Builder. 

In the example below, you perform the following:

  1. Get an instance of the DynamicModuleManager class.
  2. Resolve the name of the dynamic content type using the TypeResolutionServiceclass.
  3. Check whether a dynamic content item with the same ID already exists. 
    If an item with the same ID does not exist, create the dynamic content item by calling the CreateDataItem method of the DynamicModuleManager class. 
  4. Set the properties of the dynamic content item object.
    Passing the culture when setting the Title ensures that the dynamic content item is localized for that specific culture.
  5. Recompile the URLs of the dynamic content item.
  6. Set the ApprovalWorkflowState of the desired localized version by passing the specific culture.
  7. Publish the dynamic content item to the Live state using the content lifecycle of the DynamicModuleManager class.
  8. Save the changes.

Was this article helpful?

Next article

Localize products