erichexter / twitter.bootstrap.mvc

nuget package to make bootstrap easy with mvc4
Apache License 2.0
248 stars 134 forks source link

route localization #36

Open vkocheryzhkin opened 11 years ago

vkocheryzhkin commented 11 years ago

Eric, can you suggest how to use MapNavigationRoute if I want to have ru/en/es in my route. Thank you!

erichexter commented 11 years ago

the navigation route is just a system.web route. so you would do this the same way you would with standard mvc route. add the data token in the routes. /{ln}/home/ ect....

Eric Hexter

blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter

On Mon, Dec 17, 2012 at 5:29 AM, Vladimir notifications@github.com wrote:

Eric, can you suggest how to use MapNavigationRoute if I want to have ru/en/es in my route. Thank you!

— Reply to this email directly or view it on GitHubhttps://github.com/erichexter/twitter.bootstrap.mvc/issues/36.

vkocheryzhkin commented 11 years ago

Sure, but when you chage culture you need to set this token to all other navigation links(m.b. change Url of NamedRoute). Chage /about to be /ru/about while staing on /ru/home page, right?

erichexter commented 11 years ago

so you should do something like /{locale}/{controller} in the route.... I current dont have support for tokens with the strongly typed route helpers but the string based ones should support this. as long as you keep the tokens in all of the routes this should work as is.

Another approach is to insert the token into every route after the route table is populated. I actually use this approach for my main work website.