Use cookie everywhere
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
@ -31,8 +30,6 @@ namespace Oqtane.Extensions
|
||||
var defaultCulture = localizationManager.GetDefaultCulture();
|
||||
var supportedCultures = localizationManager.GetSupportedCultures();
|
||||
|
||||
CultureInfo.CurrentUICulture = new CultureInfo(defaultCulture);
|
||||
|
||||
app.UseRequestLocalization(options => {
|
||||
options.SetDefaultCulture(defaultCulture)
|
||||
.AddSupportedUICultures(supportedCultures)
|
||||
|
@ -1,17 +1,9 @@
|
||||
@page "/"
|
||||
@namespace Oqtane.Pages
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@using System.Globalization
|
||||
@using Microsoft.AspNetCore.Localization
|
||||
@using Microsoft.Extensions.Configuration
|
||||
@inject IConfiguration Configuration
|
||||
@model Oqtane.Pages.HostModel
|
||||
|
||||
@{
|
||||
// Set localization cookie
|
||||
var localizationCookieValue = CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(CultureInfo.CurrentCulture, CultureInfo.CurrentUICulture));
|
||||
HttpContext.Response.Cookies.Append(CookieRequestCultureProvider.DefaultCookieName, localizationCookieValue);
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
@ -362,11 +362,5 @@ Oqtane.Interop = {
|
||||
setInterval(function () {
|
||||
window.location.href = url;
|
||||
}, wait * 1000);
|
||||
},
|
||||
getLocalStorage: function (name) {
|
||||
return window.localStorage[name];
|
||||
},
|
||||
setLocalStorage: function (name, value) {
|
||||
window.localStorage[name] = value;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user