I\'m trying to plan for future (months away) localization of a new ASP.NET MVC site.
Trying to decide what makes most sense to do, as far as constructing the URLs an
I would use a different URL scheme like so :
en.mysite.com (English)
mysite.com (default language)
ro.mysite.com (Romanian)
etc.
Then I would create a custom route like in this answer.
I have exactly the same URL_mapping like you. My route also uses a constraint. Works for me.
routes.MapRoute(
// Route name
"LocalizedController",
// URL with parameters
"{language}/{controller}/{action}",
// Parameter defaults
new {
controller = "Home", action = "Index",
language = "de"
},
//Parameter constraints
new { language = @"de|en" }