How to localize the ActionName in MVC Widgets?

Posted by Community Admin on 04-Aug-2018 09:01

How to localize the ActionName in MVC Widgets?

All Replies

Posted by Community Admin on 18-Jul-2013 00:00

Hi guys,
I searched a lot to find an answer to the question in the subject.

Consider to have a custom MVC Wdget and the controller has an action SetPage(int pagenumber); so the resulting url to invoke the action should be: website-page/SetPage/pagenumber.
How to localize "SetPage"? How to make an action name localizable?

Regards,
Stefano.
codicezerouno

Posted by Community Admin on 19-Jul-2013 00:00

Hello Stefano,

 Thank you for using Sitefinity.

As a limitation of MVC the only way possible would be to add an entry to the routes table for every language you want to support? All of the localized routes could redirect to the route in the language of your choice. Check out these related questions:

Multi-lingual websites with ASP.NET MVC

How should I implement localization with ASP.NET MVC routes?

Let me know if you have any questions.

Regards,
Patrick Dunn
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 22-Jul-2013 00:00

Hi Patrick,
is there a better way to manage it for example by writing a custom route handler?

Regards,
Stefano.

Posted by Community Admin on 24-Jul-2013 00:00

Hi Stefano,

 Possible although untested since we already use a custom route handler in Sitefinity as it is.

You can check out this thread. They seem to have a decent enough idea that may work.

http://stackoverflow.com/questions/3935768/is-it-possible-to-localize-a-url-routing-in-asp-net-mvc

Regards,
Patrick Dunn
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed