Class TlumachMudBlazorServiceCollectionExtensions
Registers the MudBlazor integration of Tlumach.
public static class TlumachMudBlazorServiceCollectionExtensions
- Inheritance
-
TlumachMudBlazorServiceCollectionExtensions
- Inherited Members
Methods
AddTlumachMudBlazor(IServiceCollection, Action<TlumachMudBlazorOptions>?)
Makes the built-in texts of MudBlazor components come from Tlumach in the culture of the user.
The method registers a scoped TlumachMudLocalizer as the MudBlazor.MudLocalizer and replaces the MudBlazor.ILocalizationInterceptor of MudBlazor with a scoped MudBlazor.DefaultLocalizationInterceptor that has MudBlazor.DefaultLocalizationInterceptor.IgnoreDefaultEnglish set, so that MudBlazor asks Tlumach for every text, whatever the culture of the thread is, and shows its built-in English text for the keys that Tlumach does not have.
It also calls AddTlumachBlazor(IServiceCollection, Action<TlumachBlazorOptions>?), whose options can still be set with another call of that method.
The method can be called before or after AddMudServices. A later call of AddMudTranslations or AddLocalizationInterceptor replaces the interceptor and thus turns
the integration off. A repeated call only applies configure to the options of the first call.
public static IServiceCollection AddTlumachMudBlazor(this IServiceCollection services, Action<TlumachMudBlazorOptions>? configure = null)
Parameters
servicesIServiceCollectionThe services to add to.
configureAction<TlumachMudBlazorOptions>A callback that configures the options.
Returns
- IServiceCollection
The value of
services.