I am trying to implement the globalization to my MVC web application by using Kendo UI, the only example I found is this :
http://demos.kendoui.com/web/globalization/index.html
Which only works on the Data field such as Time and Date, the label of each fields are not converted to other language.
I also read the documentation related to Globalization in Kendo UI site, it is not enough to implement it to my project.
I appreciate if anybody can provide some detailed documents or examples of implementing Globalization by using Kendo UI,
So we can follow it step by step to implement it to our whole mvc application.
Thanks a lot,
17 Answers, 1 is accepted
The globalization feature of Kendo UI affects only date (date and month names) and number (currency symbol) formats. It will not change all labels in your page to a localized version.
I suggest you check the excellent blog post of Scott Hanselman: Globalization, Internationalization and Localization in ASP.NET MVC 3
Atanas Korchev
the Telerik team
We have purchased Kendo UI and implemented in our MVC 4 web application.
We use Grid to show our data from SQL databases, can you tell me how to make the globalization working on Grid?
Such as the column title of grid, and online editing (we need validation of online editing, the validation message need to be billingulized)? Click title to searching (a Kendo UI window popup to allow me enter the search category), how to localication those labels?
I appreciate if you can provide example code how to achieve this. If it is hard to implement Kendo Ui in globalization and localization, we may think to use other tools.
Thanks
The column titles of the grid are just strings. You can just set the titles to their localized values:
columns.Bound(o => o.OrderID).Title(Context.GetGlobalResourceString("MyResources", "OrderID")
Localization of the validation messages is described in the linked blog post.
On a side note how do you globalize the rest of your application (parts which do not include Kendo)? Could you show us some code? The same method should work with Kendo UI.
Atanas Korchev
the Telerik team
I am using telerik Kendo UI Grid view, in each column title, I applied Filter option, which popup a filer window with some fields such as:
Show items with value that:
Is equal to - this is a dropdown list field
And - another dropdown list field
Filter and Clear button (on bottom of window)
How to change all of text in this window to Another language when doing globalization and localization?
Could you please post some examples ? thanks
The easiest way would be to create a custom satellite assembly:
1. Open the source code project which is located in the C:\Program Files (x86)\Telerik\Kendo UI for ASP.NET MVC Q2 2012\src\Kendo.Mvc folder
2. Copy one of the existing Messages.*.resx files which can be found in the Resource folder of the Kendo.Mvc project
3. Name that file Messages.<culture>.resx e.g. Messages.en-GB.rex
4. Edit the strings from that resx file
5. Build the Kendo.Mvc project. This would generate a new satellite assembly for your culture.
6. Use the newly built Kendo.Mvc.dll in your application. The easiest way is to make Kendo.Mvc a project reference of your application.
Atanas Korchev
the Telerik team
"1. Open the source code project which is located in the C:\Program Files (x86)\Telerik\Kendo UI for ASP.NET MVC Q2 2012\src\Kendo.Mvc folder"
From your post, I can see "Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now! "
Can we get it from 30 days free trial version? or from OPEN Source (GPL v3) Kendo UI web? these are the link on your post:
The one we have license is just some Javascripts libraries. Not "C:\Program Files (x86)\Telerik\Kendo UI for ASP.NET MVC Q2 2012\src\Kendo.Mvc folder"
The source code is only available in the Kendo Complete for ASP.NET MVC commercial product.
Regards,Atanas Korchev
the Telerik team
Based on your solution, I have to build the Kendo.mvc to get satelite assembly and reference it in my website,
However, as my website is pure Javascript code, so I do not think my site can reference this satelite assembly, please let me know if there are any other solution? Or should I change my site from javascript code to Razor format in order to reference your satelite assembly? thanks a lot for your help,
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"
}
}
} );
The idea is to embed the localized messages in the final output of the page using Razor's @ clause.
Atanas Korchev
the Telerik team
The thing is that my page is javascript file (something like myproject.js file), not Razor page,
So @Resources.FilterInfo does not work in this case,
Please let me know if you have other option. thanks
How do you localize the other parts of your page which do not involve Kendo UI? Show us some code.
Regards,
the Telerik team
Basically, all the pages with .cshtml are OK to apply the Resource file, as we can use @Resource.Info_Text in the page with @using Resources on the top of the page,
However, in a page of xxx.js, the @Resources.Info_Text can not be recognized as I can not add usespace on the top of page as: @using Resouces.
This one line of code in my Razor page:
<li><a href="#/Contacts">@Resources.Info_Text</a></li>
Indeed, you need a cshtml in order to use Razor expressions. You will not be able to localize your JavaScript files using Razor. The Kendo grid initialization should be moved in the cshtml files.
Regards,Atanas Korchev
the Telerik team
Are there any other way to make the Filter window localized (display in two languages)?
If I have to use Razor page in order to localize my Filter popup window, then I have to change my architecture to convert my pure javascript page to Razor page.
Another option is like your mentioned here:
#######################################
Hello,
The easiest way would be to create a custom satellite assembly:
1. Open the source code project which is located in the C:\Program Files (x86)\Telerik\Kendo UI for ASP.NET MVC Q2 2012\src\Kendo.Mvc folder
2. Copy one of the existing Messages.*.resx files which can be found in the Resource folder of the Kendo.Mvc project
3. Name that file Messages.<culture>.resx e.g. Messages.en-GB.rex
4. Edit the strings from that resx file
5. Build the Kendo.Mvc project. This would generate a new satellite assembly for your culture.
6. Use the newly built Kendo.Mvc.dll in your application. The easiest way is to make Kendo.Mvc a project reference of your application.
################################
Since I can not reference satelite assembly in my .js page, so this option still not work as well.
In one word, if my site is pure javascript file, then I can not localize filter popup window to reference Resources file (make it billingulized), please do let me know if you have any workaround solution without change my javascript page and still can globalize filter window. Thanks
As far as we know there is no way to reference a .NET resource file in a JavaScript file. One needs to use a server-side technology which can embed values into the final output (Razor, ASPX etc).
Regards,Atanas Korchev
the Telerik team
Thanks!
If you do pure JS, try use expressions like: kendo.ui.FilterMenu.prototype.options.operators.string.startswith
Here you can find the JS side of the globalization 'stuff'. https://github.com/loudenvier/kendo-global/blob/master/lang/kendo.sk-SK.js