Enable and set up language fallback

In a multilanguage solution, you can use the language fallback functionality to display content in a different language if the content does not exist in the current language. This involves doing the following:

  1. Defining the language fallback rules.

  2. Enabling language fallback, either on individual sites or on all sites within the environment.

  3. As required, enabling language fallback on items, item templates, or fields.

Note

Do not use both item- and field-level fallback on the same item because it makes it difficult to maintain an overview of the versions that different items and fields fall back to.

Define the language fallback rules

For each language in your environment that you want to use for language fallback, you need to specify the language that you want it to fall back to. The fallback language specified on a language definition item applies to all the fields and items that have language fallback enabled.

You can set up a chain of language fallback. For example, as illustrated in the picture, Korean falls back to Mexican, and Mexican falls back to English. Suppose there is no Korean nor Mexican version, then the English version of the item or field is shown.

To define the language fallback rules:

  1. In the Content Editor, in the content tree, navigate to sitecore/System/Languages and click the language item that you want to specify the fallback language for.

    Note

    If any languages are missing, you can add more languages to your environment.

  2. In the Data section, in the Fallback Language field, select the relevant language.

    In the Content Editor, define the fallback language on the language item
  3. Save your changes.

Enable language fallback for the entire environment

If not already enabled, you can enable language fallback for all the sites in your environment by changing the settings in the \App_Config\Sitecore\Services.GraphQL\Sitecore.Services.GraphQL.EdgeContent.config file. Changing the configuration file also affects existing sites.

You can enable language fallback for items or fields, or both.

If you want the language fallback functionality to be enabled only for a subset of your sites, leave the configuration file unchanged and enable language fallback manually for each relevant site.

To enable language fallback for an environment:

  • Set either (or both) of the following configuration settings to true:

RequestResponse
<setting name="ExperienceEdge.EnableItemLanguageFallback" value="false"/>
<setting name="ExperienceEdge.EnableFieldLanguageFallback" value="false"/>

Enable language fallback for a site

Unless language fallback has been enabled for the entire environment, you need to enable it for each relevant site. This includes configuring language fallback for items or fields, or both.

Note

On the shell sites, language fallback is enabled by default.

To enable language fallback for a site:

  1. In the Content Editor, in the content tree, click sitecore/Content/<site collection>/<site>/Settings/Site Grouping, and then click the site item.

  2. In the Language section, select one or both of the following check boxes:

    •  Enable item language fallback .

    • Enable field language fallback.

    In the Content Editor, enable language fallback on the site definition item

Enable language fallback on an item or item template

On all the individual items or item templates where you want to use language fallback, you need to enable item-level fallback. Enabling language fallback on an item template affects all items that are based on the template.

Before you begin

Check that, in XM Cloud Content Editor, on the View tab, the Standard fields check box is selected.

To enable item-level fallback:

  1. In the Content Editor, in the content tree, navigate to the relevant item.

  2. To enable language fallback on individual items, in the Advanced section, select the Enable Item Fallback check box.

  3. To enable language fallback on an item template:

    • In the Quick Info section, click the link in the Template field.

    • In the Template Manager dialog, expand the template item and, in the Advanced section, click the __Standard Values item.

      In the Content Editor, enable language fallback on an item template
  4. Select the Enable Item Fallback check box.

  5. Save your changes.

Enable language fallback on the field definition item of an item template

If you want to use field-level language fallback, you need to enable field-level language fallback on every relevant field definition of an item template. You can do this for a specific language version of a field, or for all language versions of the field.

Note

Enabling field-level fallback can be a very tedious task, so to automate this process and perform a batch update of the field-level fallback settings, you can use the Sitecore Powershell Extensions module.

Before you begin

Check that, in the Content Editor, on the View tab, the Standard fields check box is selected.

To enable language fallback on a field definition item:

  1. In the Content Editor, in the content tree, navigate to the relevant item template and, in the Advanced section, make sure that the Enable item fallback check box is cleared.

    Enable item-level language fallback on item templates in the Content Editor
  2. Click the field definition item that you want to enable field-level fallback for.

  3. In the Data section of the item, select one or both of the following:

    • Enable field level fallback – select to enable language fallback for all the language versions of the current field. This applies to all the currently available language versions of the field and any new language versions that you create.

    • Enable versioned field level fallback – select to enable language fallback for only the currently selected language version of the field.

      By default, this setting is deactivated. To activate it, in the Sitecore.LanguageFallback.config file, set the configuration setting LanguageFieldFallback.AllowVaryFallbackSettingsPerLanguage to true. However, this reduces performance considerably.

    In the Content Editor, enable language fallback on a field template
    Note

    Some field values might be inherited from another template, in which case you must enable them on the individual templates as well.

  4. Save your changes. If you select an item that has the field you selected in step 2 and then select a language configured to fallback to, for example, English, you'll see that the field value falls back to English.

    Example of field in the Content Editor that is configured to use language fallback

Do you have some feedback for us?

If you have suggestions for improving this article,