Class XmlLocalizationProvider
Loads and retrieves translated resources from an xml document.
Namespace: EPiServer.Framework.Localization.XmlResources
Assembly: EPiServer.Framework.dll
Version: 8.11.0Syntax
public class XmlLocalizationProvider : LocalizationProvider
Constructors
XmlLocalizationProvider()
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
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 |
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 |
System.Globalization.CultureInfo | culture | The requested culture for the resource string |
Returns
Type | Description |
---|---|
System.String | A translated resource string |
Overrides
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 |