Closed mdmoura closed 11 years ago
I used AttributeRouting with localization with "real" translated routes - not just a culture prefix (~/about and ~/quemsomos in your case). I migrated from MVC4 to MVC5 and implemented / migrated some localization functions (see https://github.com/Dresel/RouteLocalizationMVC), it may be useful for you...
Dresel, I am going to take a look and test it ... I will give some feedback on the project Github.
Hello,
I am trying to replicate, in MVC 5, what Attribute Routing does in Localization.
So in ASP.NET MVC 4 with Attribute Routing I would have:
When I check it in Glimpse I have two routes:
URL: "{culture}/about" URL: "{culture}/quemsomos"
Placeholder (Default): controller (Home) // action (About)
Parameter Name (Constraint Is Match) inboundHttpMethod (Castle.Proxies.IRouteConstraintProxy) culture (Castle.Proxies.IRouteConstraintProxy_1)
How exactly does Attribute Routing makes this to work?
My idea was to have two routes with two culture constrains and default values.
URL: "{culture}/about" with default value "en" and constraint "en" URL: "{culture}/quemsomos" with default value "pt" and constraint "pt"
But I get an error when setting the second culture constraint ...
Could some one clarify how does AR does the route localization?
And where should I look in the code?
Thank You, Miguel