Created
January 9, 2018 16:52
-
-
Save DmitrySikorsky/bafea9a288dd0118fc83e06445204d0b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void Configure(IApplicationBuilder applicationBuilder) | |
| { | |
| RequestLocalizationOptions requestLocalizationOptions = new RequestLocalizationOptions(); | |
| requestLocalizationOptions.SupportedCultures = requestLocalizationOptions.SupportedUICultures = | |
| new CultureInfo[] { new CultureInfo("en"), new CultureInfo("ru"), new CultureInfo("uk") }.ToList(); | |
| requestLocalizationOptions.RequestCultureProviders.Insert(0, new RouteValueRequestCultureProvider() { Options = requestLocalizationOptions }); | |
| applicationBuilder.UseRequestLocalization(requestLocalizationOptions); | |
| applicationBuilder.UseMvc(configureRoutes => | |
| { | |
| configureRoutes.MapRoute(name: "Default", template: "{culture}/{controller}/{action}/{id?}", defaults: new { culture = "en", controller = "Default", action = "Index" }); | |
| } | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment