Try our conversational search powered by Generative AI!

Class ContentLanguage

Abstraction of the LanguageSelection class for content

Inheritance
System.Object
ContentLanguage
Namespace: EPiServer.Globalization
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public abstract class ContentLanguage : LanguageSelection

Constructors

ContentLanguage()

Declaration
protected ContentLanguage()

Fields

PreferredCultureContextKey

The cache key used to store the contxt language

Declaration
public const string PreferredCultureContextKey = "EPiServer:ContentLanguage"
Field Value
Type Description
System.String

Properties

Instance

Gets or sets the instance of Contentlanguage to use.

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

The instance.

Remarks

Assigning to this property allows you to completely replace how the preferred content language is determined by implementing the DeterminePreferredLanguage method.

PreferredCulture

Gets or sets the preferred content culture.

Declaration
public static CultureInfo PreferredCulture { get; set; }
Property Value
Type Description
System.Globalization.CultureInfo

The current culture.

Remarks

To access the language code which is used to look up information in LocalizationService and/or LanguageBranch, simply read the Name property of the returned CultureInfo object.

SpecificCulture

Gets the specific culture.

Declaration
public static CultureInfo SpecificCulture { get; }
Property Value
Type Description
System.Globalization.CultureInfo

The specific culture.

Remarks

If the PreferredCulture is a neutral culture and you need to get sort order and/or formatting information you should call this property to get the specific culture that is associated with the neutral culture. Note that if the PreferredCulture is already a specific culture, no extra object will be created.

Extension Methods