Improved localization
This commit is contained in:
parent
1af00d1e90
commit
b0de0dd165
|
@ -1,4 +1,5 @@
|
|||
@using System.Globalization
|
||||
@using Microsoft.AspNetCore.Localization
|
||||
<!DOCTYPE html>
|
||||
<html lang="@CultureInfo.CurrentUICulture.ToString()">
|
||||
|
||||
|
@ -39,3 +40,17 @@
|
|||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
public HttpContext? HttpContext { get; set; }
|
||||
|
||||
protected override void OnInitialized() {
|
||||
HttpContext?.Response.Cookies.Append(
|
||||
CookieRequestCultureProvider.DefaultCookieName,
|
||||
CookieRequestCultureProvider.MakeCookieValue(
|
||||
new RequestCulture(
|
||||
CultureInfo.CurrentCulture,
|
||||
CultureInfo.CurrentUICulture)));
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@
|
|||
@using Microsoft.AspNetCore.Components.Forms
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@using Microsoft.Extensions.Localization
|
||||
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||
@using Microsoft.JSInterop
|
||||
|
|
Loading…
Reference in a new issue