2

Field level language fallback is not working, but the item level language fallback works fine, when I don’t have version for language zh-tw, and when I load page, item from en which is fallback language for zh-tw will loads fine, but when I have version for zh-tw but field not having value, the field value not getting loading from fallback language en.

I have added below attributes to shell, website and my project site xyz

<sites>
     <site name="shell">
       <patch:attribute name="enableItemLanguageFallback">true</patch:attribute>
       <patch:attribute name="enableFieldLanguageFallback">true</patch:attribute>
     </site>
     <site name="website">
       <patch:attribute name="enableItemLanguageFallback">true</patch:attribute>
       <patch:attribute name="enableFieldLanguageFallback">true</patch:attribute>
     </site>
    <site name="xyz">
       <patch:attribute name="enableItemLanguageFallback">true</patch:attribute>
       <patch:attribute name="enableFieldLanguageFallback">true</patch:attribute>
     </site>
</sites>

The settings are reflecting correctly in showconfig, and I have enabled item fallback at standard values and field level fallback on field.

Sitecore version is 10.1.2

Fallback Language for zh-tw language is set to en.

enter image description here

enter image description here

enter image description here

1

4 Answers 4

1

Field level language fallback enables you to specify on a field-to-field basis, which field values should be localized and which field values should fall back to another language.

Field level language fallback is disabled by default, so you must enable it on each relevant website and on the template field definition item.

Follow these steps to enable the feature on your Sitecore instance:

Enable Field level language fallback on the desired sites in Sitecore configuration. This change can be done within /App_Config/Include/Sitecore.LanguageFallback.config or any other custom config include file.

<sites>   

    <site name="shell">
         <patch:attribute name="enableFieldLanguageFallback">true</patch:attribute>   </site>  
     <site name="website">
         <patch:attribute name="enableFieldLanguageFallback">true</patch:attribute>   </site>

</sites>

Hope this helps you.

1

If your fallback configuration is set up correctly and you're still not seeing fields fall back to the parent language, there may be a simple explanation. It's possible that the fields previously had a value, but you cleared them out, and this can prevent fallback from working as intended. Even though the field may be empty, an empty string is still considered a value, so the fallback won't kick in. In this case, you can reset value to original state using Reset option found under Versions tab.

If your values are indeed falling back, you should see a message in gray text next to the field, indicating that the value is being retrieved from the parent language. This is a good sign that your fallback configuration is working properly.

enter image description here

enter image description here

0

Try to verify the below things to check field level language fallback on your site.

  1. Enable Field level language fallback on the desired sites in Sitecore configuration. (As you have added in your question).
  2. Specify the fallback language rules: The fallback language is specified on a language definition item in the content tree under the /sitecore/system/Languages item. For each language that has to be enabled for fallback, ensure the Fallback Language field on that language definition item points to the desired target language.
  3. Finally, you need to enable Field level language fallback for those fields you'd like to have this feature enabled. There are two checkbox fields that enable this feature.
    • Enable field level fallback
    • Enable versioned field level fallback

Refer to this article for more details to match your configuration.

https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0111331

0

I would recommend to validate the below points from configuration that play important role in Field level language fallback implementation also I tried it with my local and it works form me.

  1. validate you have setup the language value for each site node.
<site name="xyz-en" patch:before="site[@name='website']"
            //other property configuration.

            language="en"
            />
    <site name="xyz-zh-TW" patch:before="site[@name='website']"
            //other property configuration.

            language="zh-TW"
            />
  1. Validate you have setup a fallback configuration for English(en) site as it is your fallback language for zh-TW.
<site name="xyz-en">
        <patch:attribute name="enableItemLanguageFallback">true</patch:attribute>
        <patch:attribute name="enableFieldLanguageFallback">true</patch:attribute>
    </site>
  1. It might be due to the dictionary template that you are using. I don't see Key field in your dictionary template.

Finally to give you some idea I did try my self to show you. Refer to the below steps.

  • Created a dictionary template (By coping existing dictonary from /sitecore/templates/System/Dictionary/Dictionary entry). enter image description here

  • Created new dictionary content items in English.

enter image description here

  • Check the zh-Tw value is empty.

enter image description here

  • Language configuration.

enter image description here

  • Standard value configration.

enter image description here

  • Field-level template configuration.

enter image description here

  • Result for English version.

enter image description here

  • Result for zh-Tw version.

enter image description here

Hope it helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.