Class LocalizationProvider
Provides the base class for creating a provider to handle localized resources.
Namespace: EPiServer.Framework.Localization
Assembly: EPiServer.Framework.dll
Version: 12.0.3Syntax
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. |
Name
Gets the friendly name used to refer to the provider
Declaration
public virtual string Name { get; set; }
Property Value
Type | Description |
---|---|
System. |
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. |
originalKey | The unmodified key |
System. |
normalizedKey | The |
System. |
culture | The requested culture for the resource string |
Returns
Type | Description |
---|---|
System. |
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. |
originalKey | The unmodified key |
System. |
normalizedKey | The |
System. |
culture | The requested culture for the resource string |
Returns
Type | Description |
---|---|
System. |
A translated resource string |
Initialize(String, NameValueCollection)
Initializes the provider.
Declaration
public virtual void Initialize(string name, NameValueCollection config)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | The friendly name of the provider |
System. |
config | A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider. |