Language fallback – changes to APIs
The changes to the Sitecore API that is introduced with language fallback
With the language fallback feature, the following APIs have changed.
The following properties and methods have been added to the class:
GetLabel(bool showFieldSharingLabels)– a refactored method that executes thegetFieldLabelpipeline.ContainsFallbackValue– a new property that returns true if the field contains fallback value.FallbackValueSource– a new property that returns the string descriptor of the fallback value source.GetValue(bool allowStandardValue, bool allowDefaultValue, bool allowFallbackValue)– a new method override with theallowFallbackValueparameter.
The following properties have been added to the class:
OriginalLanguage– a property that returns the original language for the current item. If the item is not a fallback item, it returns theitem.Language.IsFallback– a property that returns true if the current item is a fallback item.
The following properties have been added to the class:
EnableItemLanguageFallbackEnableFieldLanguageFallbackEnforceVersionPresence
The following property is changed:
IsReadOnly– a property that returns true if theitem.IsFallback is set totrue.
Besides the getItem, getFieldValue, and getFieldLabel pipeline processors, the following classes have been introduced to support the language fallback feature:
LanguageFallbackManagerLanguageFallbackStrategyDefaultLanguageFallbackStrategyLanguageMappingLanguageFallbackFieldValuesProviderLanguageFallbackFieldValuesCollectionLanguageFallbackFieldValuesCacheLanguageFallbackFieldValueEnforceVersionPresenceDisablerLanguageFallbackItemSwitcher