Class TlumachBlazorServiceProviderExtensions
Startup helpers for Blazor WebAssembly applications.
public static class TlumachBlazorServiceProviderExtensions
- Inheritance
-
TlumachBlazorServiceProviderExtensions
- Inherited Members
Methods
LoadTlumachCultureAsync(IServiceProvider)
Loads the stored culture and makes it the culture of the application. Call it in a Blazor WebAssembly client before RunAsync:
await host.Services.LoadTlumachCultureAsync();.
The culture is made the culture of the whole process (DefaultThreadCurrentCulture, DefaultThreadCurrentUICulture, and CurrentCulture of every translation manager) only when ApplyCultureGlobally allows it, which it does by default in the browser. Otherwise, e.g. when the method is called on a server by mistake, nothing is changed, a warning is logged, and the culture is only returned.
public static Task<CultureInfo> LoadTlumachCultureAsync(this IServiceProvider services)
Parameters
servicesIServiceProviderThe services of the host.
Returns
- Task<CultureInfo>
The culture that was loaded, and applied if ApplyCultureGlobally allows it.