Try our conversational search powered by Generative AI!

Class LocalizationProvider

Provides the base class for creating a provider to handle localized resources.

Inheritance
System.Object
LocalizationProvider
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.Framework.Localization
Assembly: EPiServer.Framework.dll
Version: 11.20.7
Syntax
public abstract class LocalizationProvider

Constructors

LocalizationProvider()

Declaration
protected LocalizationProvider()

Properties

AvailableLanguages

Gets all available languages. An available language does not need to contain any translations.

Declaration
public abstract IEnumerable<CultureInfo> AvailableLanguages { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Globalization.CultureInfo>

Name

Gets the friendly name used to refer to the provider

Declaration
public virtual string Name { get; set; }
Property Value
Type Description
System.String
Remarks

Default name is 'default'

Methods

GetAllStrings(String, String[], CultureInfo)

Gets all localized strings for a specific culture. Will return all strings below the specified key.

Declaration
public abstract IEnumerable<ResourceItem> GetAllStrings(string originalKey, string[] normalizedKey, CultureInfo culture)
Parameters
Type Name Description
System.String originalKey

The unmodified key

System.String[] normalizedKey

The originalKey normalized and split into an array

System.Globalization.CultureInfo culture

The requested culture for the resource string

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

All resource strings below the specified key

GetString(String, String[], CultureInfo)

Gets a localized string from a resource key.

Declaration
public abstract string GetString(string originalKey, string[] normalizedKey, CultureInfo culture)
Parameters
Type Name Description
System.String originalKey

The unmodified key

System.String[] normalizedKey

The originalKey normalized and split into an array

System.Globalization.CultureInfo culture

The requested culture for the resource string

Returns
Type Description
System.String

A translated resource string

Initialize(String, NameValueCollection)

Initializes the provider.

Declaration
public virtual void Initialize(string name, NameValueCollection config)
Parameters
Type Name Description
System.String name

The friendly name of the provider

System.Collections.Specialized.NameValueCollection config

A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.

Extension Methods