1

I've some localised routes. For this i mark my routes with asp mvc route attribtues and afterwards i clone them for each language with translated values and a language data token and a constraint which checks the culture / language.

for example

foo.com/en/search would be aviable in spanish as foo.com/es/búsqueda Each generated route has a language data token "language". In this case with the value "es"

Now I want to create "ChangeLanguage" links. For each language a link. I want to preserve the whoule route data. So when i',on foo.com/en/search and I click "spanisch" i want to end up in foo.com/es/búsqueda. If there are url parameters they should also be preserved.

From RouteContext i get the current RouteData with route values and datatokens. But the Url.Action class only contains overloadings to pass route data not datatokens.

How can I create the links correctly ? Or How can I find the equivilant route in the other language?

Boas Enkler
  • 12,264
  • 16
  • 69
  • 143

0 Answers0