Localization of templates

3 posts, 1 answers
  1. Dj Prpa
    Dj Prpa avatar
    20 posts
    Member since:
    Aug 2012

    Posted 08 Jan 2013 Link to this post

    I am using Kendo UI MVC wrappers. Is there a way to use resource files in templates?

    I tried to use the following code: 
    <script id="person-template" type="text/x-kendo-template">
    <span>${Resource.LastName} ${LastName}</span>
    </script>

    I've got the error: "Resource not defined". 


  2. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 09 Jan 2013 Link to this post

    Hi,

     This is a well-known JavaScript error which is thrown when the object you are accessing does not exist. Do you have a Resource JavaScript object? If not - you would get that error indeed.

     If Resource is a server-side object you should use a server-side expression to get it:

    ASPX:

    <%= Resource.LastName %>

    Razor:

    @Resource.LastName

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Dj Prpa
    Dj Prpa avatar
    20 posts
    Member since:
    Aug 2012

    Posted 09 Jan 2013 Link to this post

    Thank you Atanas. I was using server-side resource, and did solve the issue using server-side expression @Resource.LastName.
Back to Top