diff --git a/samples/LocalizationSample/Startup.cs b/samples/LocalizationSample/Startup.cs index 471a678920..218fceff51 100644 --- a/samples/LocalizationSample/Startup.cs +++ b/samples/LocalizationSample/Startup.cs @@ -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 @@ $@" host.Run(); } } -} +} \ No newline at end of file