Class LocalizerFactory
Implements the IStringLocalizerFactory interface to create instances of Localizer for localizing resources.
Implements
Inherited Members
Namespace: DataWeb.Localization
Assembly: DataWeb.Core.dll
Syntax
public sealed class LocalizerFactory : IStringLocalizerFactory
Remarks
Initializes a new instance of the LocalizerFactory class.
Constructors
LocalizerFactory(ILocalizationService, IHttpContextAccessor)
Implements the IStringLocalizerFactory interface to create instances of Localizer for localizing resources.
Declaration
public LocalizerFactory(ILocalizationService localizationService, IHttpContextAccessor httpContextAccessor)
Parameters
Type | Name | Description |
---|---|---|
ILocalizationService | localizationService | The ILocalizationService implementation to use for localization. |
IHttpContextAccessor | httpContextAccessor |
Remarks
Initializes a new instance of the LocalizerFactory class.
Methods
Create(string, string)
Creates an IStringLocalizer instance for the specified base name and location.
Declaration
public IStringLocalizer Create(string baseName, string location)
Parameters
Type | Name | Description |
---|---|---|
string | baseName | The base name of the resource to create the localizer for. |
string | location | The location of the resource to create the localizer for. |
Returns
Type | Description |
---|---|
IStringLocalizer | An IStringLocalizer instance for the specified base name and location. |
Create(Type)
Creates an IStringLocalizer instance for the specified resource source type.
Declaration
public IStringLocalizer Create(Type resourceSource)
Parameters
Type | Name | Description |
---|---|---|
Type | resourceSource | The type to create the localizer for. |
Returns
Type | Description |
---|---|
IStringLocalizer | An IStringLocalizer instance for the specified resource source type. |