Class XmlLocalizationProvider

Loads and retrieves translated resources from an xml document.

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

Constructors

XmlLocalizationProvider()

Initializes a new instance of the XmlLocalizationProvider class.

Declaration
public XmlLocalizationProvider()

Properties

AvailableLanguages

Gets all available languages from the xml document. An available language does not need to contain any translations.

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

Methods

Clear()

Clears all previous loaded translations.

Declaration
public void Clear()

GetAllStrings(String, String[], CultureInfo)

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

Declaration
public override 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

Overrides

GetString(String, String[], CultureInfo)

Gets a translated string from a language key.

Declaration
public override 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

Overrides

Initialize(String)

Initializes the provider with the default configuration.

Declaration
public void Initialize(string name)
Parameters
Type Name Description
System.String name

The name of the provider.

Load(Stream)

Extracts translations from the stream.

Declaration
public void Load(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream

An System.IO.Stream containing translated resource strings

Extension Methods