twitter.bootstrap.mvc icon indicating copy to clipboard operation
twitter.bootstrap.mvc copied to clipboard

route localization

Open vkocheryzhkin opened this issue 12 years ago • 3 comments

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

vkocheryzhkin avatar Dec 17 '12 11:12 vkocheryzhkin

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 [email protected] 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.

erichexter avatar Dec 17 '12 14:12 erichexter

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?

vkocheryzhkin avatar Dec 17 '12 15:12 vkocheryzhkin

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.

erichexter avatar Dec 22 '12 06:12 erichexter