This is a migrated thread and some comments may be shown as answers.

Localization of templates

2 Answers 138 Views
Templates
This is a migrated thread and some comments may be shown as answers.
Dj Prpa
Top achievements
Rank 1
Dj Prpa asked on 08 Jan 2013, 02:45 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 09 Jan 2013, 08:05 AM
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!
0
Dj Prpa
Top achievements
Rank 1
answered on 09 Jan 2013, 12:54 PM
Thank you Atanas. I was using server-side resource, and did solve the issue using server-side expression @Resource.LastName.
Tags
Templates
Asked by
Dj Prpa
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Dj Prpa
Top achievements
Rank 1
Share this question
or