Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

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: 7.19.2
Syntax
public abstract class LocalizationProvider : ProviderBase

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>

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

Extension Methods