Added dependency injection for `CultureService` in `App.razor` to dynamically initialize culture settings during the component's lifecycle. Included `System.Globalization` and `EnvelopeGenerator.ReceiverUI.Services` namespaces to support culture-related functionality. Injected `CultureService` and added an `OnInitializedAsync` method to set `CultureInfo.DefaultThreadCurrentCulture` and `CultureInfo.DefaultThreadCurrentUICulture` based on the service's initialization. Reformatted surrounding `<Router>` code for clarity.
24 lines
729 B
Plaintext
24 lines
729 B
Plaintext
@using System.Globalization
|
|
@using EnvelopeGenerator.ReceiverUI.Services
|
|
@inject CultureService CultureService
|
|
|
|
<Router AppAssembly="@typeof(Program).Assembly">
|
|
<Found Context="routeData">
|
|
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
|
</Found>
|
|
<NotFound>
|
|
<LayoutView Layout="@typeof(MainLayout)">
|
|
<p>Sorry, there's nothing at this address.</p>
|
|
</LayoutView>
|
|
</NotFound>
|
|
</Router>
|
|
|
|
@code {
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
var culture = await CultureService.InitializeCultureAsync();
|
|
CultureInfo.DefaultThreadCurrentCulture = culture;
|
|
CultureInfo.DefaultThreadCurrentUICulture = culture;
|
|
}
|
|
}
|