November Happy Hour will be moved to Thursday December 5th.

Class LocalizationProvider

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

Inheritance
System.Object
LocalizationProvider
Namespace: EPiServer.Framework.Localization
Assembly: EPiServer.Framework.dll
Version: 12.0.3
Syntax
public abstract class LocalizationProvider : Object

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