Localization Sample Fix

This commit is contained in:
Hisham Bin Ateya 2016-02-18 02:45:26 +03:00 committed by ryanbrandenburg
parent 324f586eeb
commit a928982055
1 changed files with 9 additions and 11 deletions

View File

@ -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();
}
}
}
}