London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Hi,
Here is a code snippet that returns the list of fallback languages:
ContentReference currentReference = ... var currentLanguage = EPiServer.Globalization.ContentLanguage.PreferredCulture.Name; var fallbackLanguages = EPiServer.Core.ContentLanguageSettingsHandler.Instance.GetFallbackLanguages(currentReference, currentLanguage);
Thanks!
That one works fine for EPiServer 7.5 but we have 7.1 so I just had to modify how I get the fallback languages:
var fallbackLanguages = PageLanguageSettingsTree.Instance.GetFallbackLanguages(Model.PageLink, Model.LanguageBranch);
I have a page that is translated to different languages. I have setup language fallback (if someone wants to view a page in language A but that language branch does not exists for that page then it should show the page in language B).
This page also has a content area.
I a page exists in language A and B but only has content in the content area in language B then I want to be able to get the content in the content area for language B when I will show the page in language A.
The thing I want to know is how I can find out what the fallback language is for that instance of page?!