The LocalizeEntities policy set
When a Commerce entity property is localizable, the Business Tools GUI lets business users add translated versions of the property string values in the supported languages. The PlugIn.LocalizeEntities.PolicySet-1.0.0.json
file contains instances of the LocalizeEntityPolicy
and LocalizeEntityComponentPolicy
policies that are responsible for making Commerce entity properties localizable.
The PlugIn.LocalizeEntities.PolicySet-1.0.0.json
file, located under wwwroot\<CommerceEngineService>\wwwroot\data\Environments
, contains two entity policy types:
-
The
Sitecore.Commerce.Core.LocalizeEntityPolicy
policy lists the properties of entity views that are exposed for localization. -
The
Sitecore.Commerce.Core.LocalizeEntityComponentPolicy
policy lists the properties of child entity views that are exposed for localization. This policy is embedded within theLocalizeEntityPolicy
policy.
The following is a sample from the PlugIn.LocalizeEntities.PolicySet-1.0.0.json
file that makes some of the sellable item entity properties and child views (component) properties localizable by default. The sample illustrates the hierarchical relationship of the LocalizeEntityPolicy
and the LocalizeEntityComponentPolicy
policies, where the sellable item entity LocalizeEntityPolicy
has a ComponentsPolicies
attribute that contains multiple imbedded instances of the LocalizeEntityComponentPolicy
policy, each with their own list of child view properties to localize.
{
"$type": "Sitecore.Commerce.Core.LocalizeEntityPolicy, Sitecore.Commerce.Core",
"Type": "Sitecore.Commerce.Plugin.Catalog.SellableItem",
"Properties": [
"DisplayName",
"Description",
"Brand"
],
"ActionView": "Details",
"ComponentsPolicies": [
{
"$type": "Sitecore.Commerce.Core.LocalizeEntityComponentPolicy, Sitecore.Commerce.Core",
"Path": "DisplayPropertiesComponent",
"Properties": [
"Color",
"Size",
"Style",
"DisambiguatingDescription"
],
"ActionView": "DisplayProperties",
"IsItemComponent": false
},
{
"$type": "Sitecore.Commerce.Core.LocalizeEntityComponentPolicy, Sitecore.Commerce.Core",
"Path": "ItemVariationsComponent.ItemVariationComponent",
"Properties": [
"DisplayName",
"Description"
],
"ActionView": "Details",
"IsItemComponent": true
},
{
"$type": "Sitecore.Commerce.Core.LocalizeEntityComponentPolicy, Sitecore.Commerce.Core",
"Path": "ItemVariationsComponent.ItemVariationComponent.DisplayPropertiesComponent",
"Properties": [
"Color",
"Size",
"Style",
"DisambiguatingDescription"
],
"ActionView": "DisplayProperties",
"IsItemComponent": true
Properties of the LocalizeEntityPolicy policy
Properties of the LocalizeEntityPolicy
policy are:
Properties |
Description |
---|---|
|
The Commerce entity type that defines properties. |
|
A list of the entity properties to make available for localization. |
|
The entity view where the properties are used. |
|
Introduces one or multiple instances of the |
Properties of the LocalizeEntityComponentPolicy policy
Properties of the LocalizeEntityComponentPolicy
policy are:
Properties |
Description |
---|---|
|
The path to the component with the display properties. |
|
A list of the display properties to make available for localization. |
|
The view where the properties are used. |
|
Used as a filter to determine whether a When set to When set to |