More in this section
Forums / Developing with Sitefinity / How to read localized resource labels in MVC widget

How to read localized resource labels in MVC widget

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Ajai
    Ajai avatar
    15 posts
    Registered:
    02 Mar 2015
    23 Sep 2016
    Link to this post

    Hi All,

    I am working on sitefinity 9.1 and focused on MVC based development with multilingual support. I have created a simple mvc widget and i want to display localized labels in that.

    I have found the below code piece that can be used in web-form widgets and master pages 

    <asp:Label runat="server" ID="lbl1" Text='<%$ Resources:NewsResources, Content %>'></asp:Label>

    and seems working fine with in my multilingual site.How can i achieve the same in mvc widget?

     

    Thanks

    Ajai

  2. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    23 Sep 2016
    Link to this post

    Hi Ajai,

    In view you can use it like that:

    <h1>@Html.Resource("ResorceLabel", "ResorceName")</h1>

    And you need @using Telerik.Sitefinity.Frontend.Mvc.Helpers for that

     

     

2 posts, 0 answered