Localization Sample Fix
This commit is contained in:
parent
324f586eeb
commit
a928982055
|
|
@ -36,21 +36,19 @@ namespace LocalizationSample
|
|||
#if !DNXCORE50
|
||||
supportedCultures.Add(new CultureInfo("zh-CHT"));
|
||||
#endif
|
||||
app.UseRequestLocalization(new RequestLocalizationOptions
|
||||
{
|
||||
var options = new RequestLocalizationOptions {
|
||||
DefaultRequestCulture = new RequestCulture("en-US"),
|
||||
|
||||
// Set options here to change middleware behavior
|
||||
SupportedCultures = supportedCultures,
|
||||
SupportedUICultures = supportedCultures
|
||||
};
|
||||
// Optionally create an app-specific provider with just a delegate, e.g. look up user preference from DB.
|
||||
// Inserting it as position 0 ensures it has priority over any of the default providers.
|
||||
//options.RequestCultureProviders.Insert(0, new CustomRequestCultureProvider(async context =>
|
||||
//{
|
||||
|
||||
// Optionally create an app-specific provider with just a delegate, e.g. look up user preference from DB.
|
||||
// Inserting it as position 0 ensures it has priority over any of the default providers.
|
||||
//RequestCultureProviders.Insert(0, new CustomRequestCultureProvider(async context =>
|
||||
//{
|
||||
//}));
|
||||
|
||||
//}))
|
||||
});
|
||||
app.UseRequestLocalization(options);
|
||||
|
||||
app.Use(async (context, next) =>
|
||||
{
|
||||
|
|
@ -165,4 +163,4 @@ $@"<!doctype html>
|
|||
host.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue