Try our conversational search powered by Generative AI!

Class DefaultContentLanguageSettingsHandler

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Tracks all language settings on a site with support for resolving closest setting at runtime

Inheritance
System.Object
DefaultContentLanguageSettingsHandler
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Core.Internal
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
[ServiceConfiguration(ServiceType = typeof(IContentLanguageSettingsHandler), FactoryMember = "Instance")]
[ServiceConfiguration(ServiceType = typeof(DefaultContentLanguageSettingsHandler), Lifecycle = ServiceInstanceScope.Singleton)]
public class DefaultContentLanguageSettingsHandler : IContentLanguageSettingsHandler

Constructors

DefaultContentLanguageSettingsHandler(ServiceAccessor<IContentLoader>, ILanguageBranchRepository, IContentLanguageSettingsResolver)

Declaration
public DefaultContentLanguageSettingsHandler(ServiceAccessor<IContentLoader> contentLoader, ILanguageBranchRepository languageBranchRepository, IContentLanguageSettingsResolver contentLanguageSettingsResolver)
Parameters
Type Name Description
ServiceAccessor<IContentLoader> contentLoader
ILanguageBranchRepository languageBranchRepository
IContentLanguageSettingsResolver contentLanguageSettingsResolver

Properties

Instance

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. The global instance of ContentLanguageSettingsHandler that is used to access information about language settings

Declaration
public static DefaultContentLanguageSettingsHandler Instance { get; }
Property Value
Type Description
DefaultContentLanguageSettingsHandler

Methods

Clear()

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Clears all currently loaded settings for this instance.

Declaration
public static void Clear()
Remarks

This can be used to force a reload of the settings tree.

ClearCache()

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Clears all currently loaded settings for this instance.

Declaration
public void ClearCache()
Remarks

This can be used to force a reload of the settings tree.

Get(ContentReference)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the settings for all languages for the specified content link.

Declaration
public virtual IEnumerable<ContentLanguageSetting> Get(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content link.

Returns
Type Description
System.Collections.Generic.IEnumerable<ContentLanguageSetting>

An ContentLanguageSetting[] with the language settings for the given content.

Get(ContentReference, String)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the settings for specified content link and language.

Declaration
public virtual ContentLanguageSetting Get(ContentReference contentLink, string languageBranch)
Parameters
Type Name Description
ContentReference contentLink

The content link.

System.String languageBranch

The language branch.

Returns
Type Description
ContentLanguageSetting

Gets the affective language settings for the content and language or null if no settings exists.

GetDefaultAllowedLanguage(ContentReference)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Try finding the default language if allowed, otherwise fallback to the first allowed language found

Declaration
public virtual string GetDefaultAllowedLanguage(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content to fetch language for

Returns
Type Description
System.String

GetFallbackLanguages(ContentReference, String)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the fallback languages for the current content and language if any exists.

Declaration
public virtual string[] GetFallbackLanguages(ContentReference contentLink, string languageBranch)
Parameters
Type Name Description
ContentReference contentLink

The content link.

System.String languageBranch

The language branch.

Returns
Type Description
System.String[]

A String[] with the names of the fallback languages.

Remarks

If no fallback languages are defined for the current content and language an empty string array is returned.

IsLanguageAllowed(ContentReference, String)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Checks if a language is available for a content

Declaration
public virtual bool IsLanguageAllowed(ContentReference contentLink, string languageBranch)
Parameters
Type Name Description
ContentReference contentLink

The content to check

System.String languageBranch

The language to check

Returns
Type Description
System.Boolean

True if the language is allowed on the content

IsLanguageAllowedForCreation(ContentReference, String)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Determins if a content is allowed in a specific language

Declaration
public virtual bool IsLanguageAllowedForCreation(ContentReference contentLink, string languageBranch)
Parameters
Type Name Description
ContentReference contentLink

The content to check

System.String languageBranch

The language to check if it's allowed for the content

Returns
Type Description
System.Boolean

True if the language is allowed for the content

Remarks

If no restrictions set on contents, the language must at least be part of the enabled languages for the site

IsSettingsDefined(ContentReference)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Determines whether there exists language settings for the given content.

Declaration
public virtual bool IsSettingsDefined(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content link.

Returns
Type Description
System.Boolean

true if language settings exists; otherwise, false.

MatchLanguageSettings(IContent, String)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Matches a content instance against a requestedLanguage to see if the language version of the content instance matches settings for replacement or fallback.

Declaration
public virtual LanguageSelectionSource MatchLanguageSettings(IContent content, string requestedLanguage)
Parameters
Type Name Description
IContent content

The content instance to match settings against.

System.String requestedLanguage

The language the content instance was requested for.

Returns
Type Description
LanguageSelectionSource

Requested if the language version for the content matches requestedLanguage. Replacement if the language version for the content matches the replacement setting. Fallback if the language version for the content matches the fallback setting. ReplacementFallback if the language version for the content matches the fallback setting when requestedLanguage was replaced. Noneif requestedLanguage is null or empty or if language does not implement ILocalizable or if the language version for the content does not match either replacement or fallback setting.

Implements

Extension Methods