Ok so I have a website which is non-english. All the links should be named in that language but I still want my code and my controllers to be in english. What is the best solution for this.
I have no need to use local of the user, nor having a website/locale/site . I just need to translate website/pagenameinforeignlanguage to EnglishController.
Is the only option to override the controllerfactory in to do this on the controller level? ActionName would have been usefull but it feels like I will have to use the same controller for everything then and I would like to avoid that.
Hi, thanks for the suggestion. I made a new controllerfactory overriding the createcontroller method and well that worked. Problem is that the actionlinks will still refer to the english names, think Im going to have to name the source-code files in their
native tounge.
Todilo
Member
4 Points
7 Posts
Rerouting from dictionary for translating controller name
Mar 23, 2012 03:44 PM|LINK
Ok so I have a website which is non-english. All the links should be named in that language but I still want my code and my controllers to be in english. What is the best solution for this.
I have no need to use local of the user, nor having a website/locale/site . I just need to translate website/pagenameinforeignlanguage to EnglishController.
ignatandrei
All-Star
134535 Points
21583 Posts
Moderator
MVP
Re: Rerouting from dictionary for translating controller name
Mar 23, 2012 03:47 PM|LINK
ActionName("Foreign name for the action")
http://msdn.microsoft.com/en-us/library/system.web.mvc.actionnameattribute.aspx
Todilo
Member
4 Points
7 Posts
Re: Rerouting from dictionary for translating controller name
Mar 23, 2012 04:11 PM|LINK
Hi, thanks for a quick reply.
Is this possible to do on a controller level as well?
Otherwise one controller would have to support the whole application
url/action,
I would like url/controller (and in som cases url/controller/action ) .
Todilo
Member
4 Points
7 Posts
Re: Rerouting from dictionary for translating controller name
Mar 26, 2012 06:16 AM|LINK
Is the only option to override the controllerfactory in to do this on the controller level? ActionName would have been usefull but it feels like I will have to use the same controller for everything then and I would like to avoid that.
ignatandrei
All-Star
134535 Points
21583 Posts
Moderator
MVP
Re: Rerouting from dictionary for translating controller name
Mar 26, 2012 07:31 AM|LINK
look at controller factory
http://bradwilson.typepad.com/blog/2010/07/service-location-pt2-controllers.html
Todilo
Member
4 Points
7 Posts
Re: Rerouting from dictionary for translating controller name
Mar 27, 2012 06:01 AM|LINK
Hi, thanks for the suggestion. I made a new controllerfactory overriding the createcontroller method and well that worked. Problem is that the actionlinks will still refer to the english names, think Im going to have to name the source-code files in their native tounge.