Class AbstractLocalizationInterceptor
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Provides a base implementation for ILocalizationInterceptor.
public abstract class AbstractLocalizationInterceptor : ILocalizationInterceptor
- Inheritance
-
AbstractLocalizationInterceptor
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
AbstractLocalizationInterceptor(IStringLocalizer, MudLocalizer?)
Initializes a new instance of the AbstractLocalizationInterceptor class.
protected AbstractLocalizationInterceptor(IStringLocalizer localizer, MudLocalizer? mudLocalizer = null)
Parameters
localizer
IStringLocalizerThe instance of IStringLocalizer.
mudLocalizer
MudLocalizerThe optional custom MudLocalizer.
AbstractLocalizationInterceptor(ILoggerFactory, MudLocalizer?)
Initializes a new instance of the AbstractLocalizationInterceptor class. This creates an ResX reader for builtin LanguageResource with the default LocalizationOptions.
protected AbstractLocalizationInterceptor(ILoggerFactory loggerFactory, MudLocalizer? mudLocalizer = null)
Parameters
loggerFactory
ILoggerFactoryThe logger factory.
mudLocalizer
MudLocalizerThe optional custom MudLocalizer.
Remarks
For more custom options use AbstractLocalizationInterceptor(IStringLocalizer, MudLocalizer?) constuctor.
Properties
Localizer
Gets the IStringLocalizer for internal translations.
protected IStringLocalizer Localizer { get; }
Property Value
MudLocalizer
Gets the custom MudLocalizer for additional translations, if provided.
protected MudLocalizer? MudLocalizer { get; }
Property Value
Methods
Handle(string, params object[])
Retrieves the translation corresponding to the provided translation key.
public abstract LocalizedString Handle(string key, params object[] arguments)
Parameters
key
stringThe name of the string resource.
arguments
object[]The list of arguments to be passed to the string resource.
Returns
- LocalizedString
The string resource as a LocalizedString.
Remarks
The value of ResourceNotFound should be true
if no translation is available for the specified key.