Reacting to middleware configureOptions updates
This commit is contained in:
parent
399e516065
commit
b7d95d813d
|
|
@ -25,13 +25,12 @@ namespace InlineConstraintSample.Web
|
||||||
|
|
||||||
public void Configure(IApplicationBuilder app)
|
public void Configure(IApplicationBuilder app)
|
||||||
{
|
{
|
||||||
// Ignore ambient and client locale. Use same values as ReplaceCultureAttribute / CultureReplacerMiddleware.
|
app.UseRequestLocalization(localizationOptions =>
|
||||||
var localizationOptions = new RequestLocalizationOptions
|
|
||||||
{
|
{
|
||||||
DefaultRequestCulture = new RequestCulture("en-GB", "en-US"),
|
// Ignore ambient and client locale. Use same values as ReplaceCultureAttribute / CultureReplacerMiddleware.
|
||||||
};
|
localizationOptions.DefaultRequestCulture = new RequestCulture("en-GB", "en-US");
|
||||||
localizationOptions.RequestCultureProviders.Clear();
|
localizationOptions.RequestCultureProviders.Clear();
|
||||||
app.UseRequestLocalization(localizationOptions);
|
});
|
||||||
|
|
||||||
app.UseMvc();
|
app.UseMvc();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,21 +22,20 @@ namespace LocalizationSample.Web
|
||||||
|
|
||||||
public void Configure(IApplicationBuilder app)
|
public void Configure(IApplicationBuilder app)
|
||||||
{
|
{
|
||||||
var options = new RequestLocalizationOptions
|
app.UseRequestLocalization(options =>
|
||||||
{
|
{
|
||||||
DefaultRequestCulture = new RequestCulture("en-US"),
|
options.DefaultRequestCulture = new RequestCulture("en-US");
|
||||||
SupportedCultures = new List<CultureInfo>
|
options.SupportedCultures = new List<CultureInfo>
|
||||||
{
|
{
|
||||||
new CultureInfo("fr"),
|
new CultureInfo("fr"),
|
||||||
new CultureInfo("en-GB"),
|
new CultureInfo("en-GB"),
|
||||||
},
|
};
|
||||||
SupportedUICultures = new List<CultureInfo>
|
options.SupportedUICultures = new List<CultureInfo>
|
||||||
{
|
{
|
||||||
new CultureInfo("fr"),
|
new CultureInfo("fr"),
|
||||||
new CultureInfo("en-GB"),
|
new CultureInfo("en-GB"),
|
||||||
},
|
};
|
||||||
};
|
});
|
||||||
app.UseRequestLocalization(options);
|
|
||||||
|
|
||||||
app.UseMvcWithDefaultRoute();
|
app.UseMvcWithDefaultRoute();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,23 +43,22 @@ namespace RazorWebSite
|
||||||
|
|
||||||
public void Configure(IApplicationBuilder app)
|
public void Configure(IApplicationBuilder app)
|
||||||
{
|
{
|
||||||
var options = new RequestLocalizationOptions
|
app.UseRequestLocalization(options =>
|
||||||
{
|
{
|
||||||
DefaultRequestCulture = new RequestCulture("en-GB", "en-US"),
|
options.DefaultRequestCulture = new RequestCulture("en-GB", "en-US");
|
||||||
SupportedCultures = new List<CultureInfo>
|
options.SupportedCultures = new List<CultureInfo>
|
||||||
{
|
{
|
||||||
new CultureInfo("fr"),
|
new CultureInfo("fr"),
|
||||||
new CultureInfo("en-GB"),
|
new CultureInfo("en-GB"),
|
||||||
new CultureInfo("en-US"),
|
new CultureInfo("en-US"),
|
||||||
},
|
};
|
||||||
SupportedUICultures = new List<CultureInfo>
|
options.SupportedUICultures = new List<CultureInfo>
|
||||||
{
|
{
|
||||||
new CultureInfo("fr"),
|
new CultureInfo("fr"),
|
||||||
new CultureInfo("en-GB"),
|
new CultureInfo("en-GB"),
|
||||||
new CultureInfo("en-US"),
|
new CultureInfo("en-US"),
|
||||||
},
|
};
|
||||||
};
|
});
|
||||||
app.UseRequestLocalization(options);
|
|
||||||
|
|
||||||
app.UseMvcWithDefaultRoute();
|
app.UseMvcWithDefaultRoute();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue