Class LocalizerFactory
Implements the Microsoft.Extensions.Localization.IStringLocalizerFactory interface to create instances of Localizer for localizing resources.
Inheritance
Implements
Inherited Members
Namespace: DataWeb.Localization
Assembly: DataWeb.Core.dll
Syntax
public class LocalizerFactory : IStringLocalizerFactory
Constructors
LocalizerFactory(ILocalizationService, IServiceProvider)
Initializes a new instance of the LocalizerFactory class.
Declaration
public LocalizerFactory(ILocalizationService localizationService, IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
ILocalizationService | localizationService | The ILocalizationService implementation to use for localization. |
IServiceProvider | serviceProvider | The System.IServiceProvider instance to use for dependency injection. |
Methods
Create(string, string)
Creates an Microsoft.Extensions.Localization.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 Microsoft.Extensions.Localization.IStringLocalizer instance for the specified base name and location. |
Create(Type)
Creates an Microsoft.Extensions.Localization.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 Microsoft.Extensions.Localization.IStringLocalizer instance for the specified resource source type. |