Reputation: 319
I've been trying to implement a complete localization in the Kendo UI widgets using the resource files but not able to get any specific result.
What I want is to localize each and every messages of the widgets. Can anybody suggest how to implement this using resource files?
Is there any difference in implementing localization in Kendo Grid's JQuery syntax and razor syntax?
Upvotes: 4
Views: 3385
Reputation: 12875
Option 1 - Custom Resource File
You can inject your own messages into the Kendo widgets. If your resources are named Resources.resx you can set the localization messages like this:
$("#grid").kendoGrid( {
filterable: {
messages: {
info: "@Resources.FilterInfo",
filter: "@Resources.Filter"
}
}
});
You can only do this in your razor files.
Option 2 - Messages File
You can use the messages files to automatically localize your Kendo UI, as shown here.
If the CurrentUICulture is set (from code or web.config) Telerik UI for ASP.NET MVC will use localized user interface messages.
Telerik UI for ASP.NET MVC comes with localized messages for the following cultures:
If the CurrentUICulture is not supported the default "en-US" will be used.
In this case you can create your own messages file and reference it in your code, as shown here.
Upvotes: 4