Browse Source

Add middleware to set default culture to English

pull/152/head
selmankoc 3 months ago
parent
commit
b63468a9f1
  1. 9
      src/EventHub.Web/EventHubWebModule.cs

9
src/EventHub.Web/EventHubWebModule.cs

@ -19,6 +19,7 @@ using Microsoft.OpenApi;
using Payment.Web; using Payment.Web;
using StackExchange.Redis; using StackExchange.Redis;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account; using Volo.Abp.Account;
using Volo.Abp.AspNetCore.Authentication.OpenIdConnect; using Volo.Abp.AspNetCore.Authentication.OpenIdConnect;
@ -254,6 +255,14 @@ namespace EventHub.Web
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
app.Use(async (context, next) =>
{
var culture = new CultureInfo("en");
CultureInfo.CurrentCulture = culture;
CultureInfo.CurrentUICulture = culture;
await next();
});
app.UseAbpRequestLocalization(options => app.UseAbpRequestLocalization(options =>
{ {
options.DefaultRequestCulture = new RequestCulture("en"); options.DefaultRequestCulture = new RequestCulture("en");

Loading…
Cancel
Save