+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How to localize the ActionName in MVC Widgets?

How to localize the ActionName in MVC Widgets?

4 posts, 0 answered
  1. codicezerouno
    codicezerouno avatar
    21 posts
    Registered:
    02 Feb 2009
    18 Jul 2013
    Link to this post
    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
  2. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    19 Jul 2013
    Link to this post
    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
  3. codicezerouno
    codicezerouno avatar
    21 posts
    Registered:
    02 Feb 2009
    22 Jul 2013 in reply to Patrick Dunn
    Link to this post
    Hi Patrick,
    is there a better way to manage it for example by writing a custom route handler?

    Regards,
    Stefano.
  4. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    24 Jul 2013
    Link to this post
    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
4 posts, 0 answered