turquoiseowl / i18n

Smart internationalization for ASP.NET
Other
556 stars 155 forks source link

Urls for ActionResults of Controller named Map fail #208

Closed mmunchandersen closed 9 years ago

mmunchandersen commented 9 years ago

In an asp.net mvc website I have a Controller called MapController. When I hook up any ActionResult function in the MapController the language tag (en/fr) is not prefixed to the url:

@Html.ActionLink("[#[Map reporting]#]", "Index", "Map") becomes Map reporting (should have been Map reporting)

If I change the name of the controller to MappingController the url is prefixed correctly:

@Html.ActionLink("[#[Map reporting]#]", "Index", "Mapping") becomes Map reporting

I have updated to the latest version and tried everything else (I think) before renaming the controller.

turquoiseowl commented 9 years ago

Is it the same for any 3-letter controller name? E.g XyzController?

turquoiseowl commented 9 years ago

If so, please see #201.

mmunchandersen commented 9 years ago

Yes, I see the same pattern with a controller named AbcController. I can live with not naming controllers matching the language tag detection pattern as stated in https://github.com/turquoiseowl/i18n/issues/201

turquoiseowl commented 9 years ago

Right you are.

Just to note down an idea I've had on this point: we could generate the language tag regex dynamically during runtime initialization based on the ApplicationLanguages found.