Language Falling for you…

Once upon a time we spoke just English and then we made new friends across the time zones and geographical borders. Now we are trying to learn their language and get to know better. This is taking time and we still use English in some instances to avoid an awkward pause in dialogue.

Yes, I am still speaking Sitecore (v9.0.2) and the big topic today is Language Fallback and particularly the process of enabling new language versions to automatically have all the predefined fallback language’s content. Sitecore provides a great feature of Language Fallback for content to automatically render in the defined fallback language for elements not having a intended language version.

https://doc.sitecore.com/developers/90/sitecore-experience-manager/en/enable-and-set-up-language-fallback.html

The enabling is a 3-step process.

One…..Enable Item Fallback for all the template standard values to ensure new content automatically renders in the defined fallback language. For this I used a script as detailed by Shu Jackson in

https://blogs.perficientdigital.com/2017/06/20/sitecore-powershell-enable-item-level-language-fallback/

Two…..Enable Item Fallback for all existing content.This was necessary in for our client’s existing sites. I wrote a powershell extension script, for accomplishing the task.

More about Powershell Extensions here https://marketplace.sitecore.net/en/Modules/Sitecore_PowerShell_console.aspx

Three…..So tempted to write last but not the least (:rolling eyes 🙂 the background task of actually moving the final renderings to the new language version. This proved exceptionally useful for our use case of what we call “Experience Blocks”. Somewhere on the lines of Jeff Darchuk’s blog post https://jeffdarchuk.com/2015/10/18/render-item-to-string-mvc/

For this I trapped the item:versionAdded event and copied the Final Layout renderings to the new version.

I will not bore you with the details of patching your code into the pipeline etc. etc. (I’m sure you know it all 🙂

Hope this helps!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s