parent
c9ff84b7e5
commit
354facf4ad
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
|
|
@ -6,6 +7,7 @@ using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore;
|
|||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
|
@ -113,6 +115,16 @@ namespace MusicStore
|
|||
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
// force the en-US culture, so that the app behaves the same even on machines with different default culture
|
||||
var supportedCultures = new[] { new CultureInfo("en-US") };
|
||||
|
||||
app.UseRequestLocalization(new RequestLocalizationOptions
|
||||
{
|
||||
DefaultRequestCulture = new RequestCulture("en-US"),
|
||||
SupportedCultures = supportedCultures,
|
||||
SupportedUICultures = supportedCultures
|
||||
});
|
||||
|
||||
app.UseStatusCodePagesWithRedirects("~/Home/StatusCodePage");
|
||||
|
||||
// Display custom error page in production when error occurs
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using Microsoft.AspNetCore.Authentication.OAuth;
|
||||
using Microsoft.AspNetCore.Authentication.Twitter;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
|
|
@ -8,6 +9,7 @@ using Microsoft.AspNetCore.Hosting;
|
|||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
|
@ -155,6 +157,16 @@ namespace MusicStore
|
|||
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
// force the en-US culture, so that the app behaves the same even on machines with different default culture
|
||||
var supportedCultures = new[] { new CultureInfo("en-US") };
|
||||
|
||||
app.UseRequestLocalization(new RequestLocalizationOptions
|
||||
{
|
||||
DefaultRequestCulture = new RequestCulture("en-US"),
|
||||
SupportedCultures = supportedCultures,
|
||||
SupportedUICultures = supportedCultures
|
||||
});
|
||||
|
||||
app.UseStatusCodePagesWithRedirects("~/Home/StatusCodePage");
|
||||
|
||||
// Error page middleware displays a nice formatted HTML page for any unhandled exceptions in the request pipeline.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
using System.Globalization;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
@ -170,6 +172,16 @@ namespace MusicStore
|
|||
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
// force the en-US culture, so that the app behaves the same even on machines with different default culture
|
||||
var supportedCultures = new[] { new CultureInfo("en-US") };
|
||||
|
||||
app.UseRequestLocalization(new RequestLocalizationOptions
|
||||
{
|
||||
DefaultRequestCulture = new RequestCulture("en-US"),
|
||||
SupportedCultures = supportedCultures,
|
||||
SupportedUICultures = supportedCultures
|
||||
});
|
||||
|
||||
// Configure Session.
|
||||
app.UseSession();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Security.Claims;
|
||||
using System.Security.Principal;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
@ -95,6 +97,16 @@ namespace MusicStore
|
|||
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
// force the en-US culture, so that the app behaves the same even on machines with different default culture
|
||||
var supportedCultures = new[] { new CultureInfo("en-US") };
|
||||
|
||||
app.UseRequestLocalization(new RequestLocalizationOptions
|
||||
{
|
||||
DefaultRequestCulture = new RequestCulture("en-US"),
|
||||
SupportedCultures = supportedCultures,
|
||||
SupportedUICultures = supportedCultures
|
||||
});
|
||||
|
||||
app.UseStatusCodePagesWithRedirects("~/Home/StatusCodePage");
|
||||
|
||||
// Error page middleware displays a nice formatted HTML page for any unhandled exceptions in the
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
using System.Globalization;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
@ -114,6 +116,16 @@ namespace MusicStore
|
|||
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
// force the en-US culture, so that the app behaves the same even on machines with different default culture
|
||||
var supportedCultures = new[] { new CultureInfo("en-US") };
|
||||
|
||||
app.UseRequestLocalization(new RequestLocalizationOptions
|
||||
{
|
||||
DefaultRequestCulture = new RequestCulture("en-US"),
|
||||
SupportedCultures = supportedCultures,
|
||||
SupportedUICultures = supportedCultures
|
||||
});
|
||||
|
||||
app.UseStatusCodePagesWithRedirects("~/Home/StatusCodePage");
|
||||
|
||||
// Display custom error page in production when error occurs
|
||||
|
|
|
|||
Loading…
Reference in New Issue