Update to latest `UseRequestLocalization()` signature
- build break nit: add more trailing commas in init syntax
This commit is contained in:
parent
56c6975a21
commit
8a310b35a4
|
|
@ -40,9 +40,12 @@ namespace InlineConstraintSample.Web
|
|||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
// Ignore ambient and client locale. Use same values as ReplaceCultureAttribute / CultureReplacerMiddleware.
|
||||
var localizationOptions = new RequestLocalizationOptions();
|
||||
var localizationOptions = new RequestLocalizationOptions
|
||||
{
|
||||
DefaultRequestCulture = new RequestCulture("en-GB", "en-US"),
|
||||
};
|
||||
localizationOptions.RequestCultureProviders.Clear();
|
||||
app.UseRequestLocalization(localizationOptions, new RequestCulture("en-GB", "en-US"));
|
||||
app.UseRequestLocalization(localizationOptions);
|
||||
|
||||
app.UseMvc();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,18 +23,19 @@ namespace LocalizationSample.Web
|
|||
{
|
||||
var options = new RequestLocalizationOptions
|
||||
{
|
||||
DefaultRequestCulture = new RequestCulture("en-US"),
|
||||
SupportedCultures = new List<CultureInfo>
|
||||
{
|
||||
new CultureInfo("fr"),
|
||||
new CultureInfo("en-GB")
|
||||
new CultureInfo("en-GB"),
|
||||
},
|
||||
SupportedUICultures = new List<CultureInfo>
|
||||
{
|
||||
new CultureInfo("fr"),
|
||||
new CultureInfo("en-GB")
|
||||
}
|
||||
new CultureInfo("en-GB"),
|
||||
},
|
||||
};
|
||||
app.UseRequestLocalization(options, new RequestCulture("en-US"));
|
||||
app.UseRequestLocalization(options);
|
||||
|
||||
app.UseMvcWithDefaultRoute();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,20 +44,21 @@ namespace RazorWebSite
|
|||
{
|
||||
var options = new RequestLocalizationOptions
|
||||
{
|
||||
DefaultRequestCulture = new RequestCulture("en-GB", "en-US"),
|
||||
SupportedCultures = new List<CultureInfo>
|
||||
{
|
||||
new CultureInfo("fr"),
|
||||
new CultureInfo("en-GB"),
|
||||
new CultureInfo("en-US")
|
||||
new CultureInfo("en-US"),
|
||||
},
|
||||
SupportedUICultures = new List<CultureInfo>
|
||||
{
|
||||
new CultureInfo("fr"),
|
||||
new CultureInfo("en-GB"),
|
||||
new CultureInfo("en-US")
|
||||
}
|
||||
new CultureInfo("en-US"),
|
||||
},
|
||||
};
|
||||
app.UseRequestLocalization(options, new RequestCulture("en-GB", "en-US"));
|
||||
app.UseRequestLocalization(options);
|
||||
|
||||
app.UseMvcWithDefaultRoute();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue