Enable publishing language fallback
Sitecore can display item content in a fallback language.
The Experience Edge Connector supports language fallback when you publish items to a delivery platform. When you publish the fallback language version of an item, the Experience Edge Connector checks for other dependent language versions and publishes them as well. This ensures static content for the item is available for all dependent languages on Experience Edge.
Item-level language fallback
The following diagram shows an example of how item-level language fallback with a fallback chain of three languages:
In the diagram, Sitecore has only one English version for Item 3.
When Sitecore renders dynamically, it uses the en
fallback version when it tries to render the item for en-nz
(which does not have a version).
When rendering statically, the Experience Edge Connector publishes this item, using the fallback version for all dependent languages (en-au
, en-nz
) to get a similar result in Experience Edge. The next sections describe how the Experience Edge Connector supports language fallback in detail.
When the Experience Edge Connector publishes the fallback language version of an item, it gets other dependent languages and identifies languages without a version for that item and publishes these as well.
The languages in the diagram have these dependencies:
-
en-nz
has a direct dependency onen-au
-
en-au
has a direct dependency onen
-
en-nz
has an indirect dependency onen
The Experience Edge Connector takes the following actions when publishing:
-
Publishing the
en
version of Item 1:All dependent languages have version of Item1. No language fallback is necessary, and only the
en
version of Item 1 is published. -
Publishing the
en
version of Item 2:There is a version of Item 2 in the directly dependent language
en-au
, No language fallback is necessary, and only theen
version of Item 2 published. -
Publishing the
en-au
version of Item 2:Item 2 does not have a version in all dependent languages. Language fallback is used, and the
en-nz
version is Item 2 as well. -
Publishing the
en
version of Item 3:Item 3 does not have a version in all dependent languages. Language fallback is used, and the
en-
au anden-nz
versions are published for Item 3 as well.
Field-level language fallback
When the Experience Edge Connector publishes the fallback language version of an item, the connector also retrieves the dependent languages and identifies which ones have versions with fallback field values for that item, and then publishes these as well. The example setup in the following diagram shows items with field language fallback:
The languages in the diagram have these dependencies:
-
en-nz
has direct dependency onen-au
-
en-au
has direct dependency onen
-
en-nz
has indirect dependency onen
The Experience Edge Connector takes the following actions when publishing:
-
Publishing the
en
version of Item 1:All dependent languages have versions of Item 1 and fallback fields have their own values in each language. No language fallback is necessary, and only the
en
version of Item 1 is published. -
Publishing the
en
version of Item 2:There is a version for Item 2 in direct dependent language
en-au
and fallback field has its own value, language fallback is not applied and only Item 2en
version is published -
Publishing the
en-au
version of Item 2:There are versions of Item 2 in all dependent languages and fallbacks fields have fallback values. Language fallback is used, and the
en-nz
version is published as well. -
Publishing the
en
version of Item 3:There are version of Item 3 in all dependent languages and fallback fields have fallback values. Language fallback is used, and the
en-au
anden-nz
versions are published as well.
Identifying dependencies between languages
This section explains the process the Experience Edge Connector follows to identify the dependent language versions that it must publish.
The process is as follows:
-
The connector prepares the fallback dependency relation between the system languages (
en
<-en-au
<-en-nz
in the diagrams). -
When the connector publishes a version of an item, it prepares a list of dependent languages from the fallback dependency relation, based on the published version.
-
The connector verifies whether item-level language fallback is applicable for the dependent languages. Item-based fallback is available if:
-
The item is item-fallback enabled.
-
The item does not have a version in the dependent language.
-
-
The connector verifies whether field-level language fallback is applicable for the dependent languages. Field-level fallback is available if:
-
The item has one or more fields with field-level language fallback enabled.
-
The item has a version in the dependent language and the value of the field (or fields) are from the fallback language (the published version).
-
Enable language fallback
To enable language fallback, set either (or both) of these configuration settings to true
:
<setting name="ExperienceEdge.EnableItemLanguageFallback" value="false"/>
<setting name="ExperienceEdge.EnableFieldLanguageFallback" value="false"/>