This is a migrated thread and some comments may be shown as answers.
How can we set localization to Kendo date picker for non culture specified language?
1 Answer 138 Views
This is a migrated thread and some comments may be shown as answers.
Jayesh
Top achievements
Rank 1
Jayesh asked on 10 Jun 2016, 09:55 AM

I know, by applying kendo.culture() to kendoDatePicker control will set the localization to control and changes the name of month and day accordingly. But how can we change the name of month and day of datepicker control for language which does not have specified culture manually.

For e.g: I have a requirement to display datePicker for Belaurs which have culture (be-BY) and language as Russian. Kendo does not have a language package for the same. Is there any way for me to set the translation manually? .

When I checked the language pack of Kendo, Kendo provides "localization" property for controls like Upload, grid etc, where we can manually set the translated text to get them displayed (as shown below). Is there any option like that for "datePicker" ?

if (kendo.ui.Upload) {
kendo.ui.Upload.prototype.options.localization =
$.extend(true, kendo.ui.Upload.prototype.options.localization,{
  "cancel": "Beenden",
  "dropFilesHere": "Dateien hier fallen lassen zum Hochladen",
  "remove": "Löschen",
  "retry": "Wiederholen",
  "select": "Wählen Sie...",
  "statusFailed": "nicht erfolgreich",
  "statusWarning": "Warnung",
  "statusUploaded": "hochgeladen",
  "statusUploading": "hochladen",
  "uploadSelectedFiles": "Dateien hochladen",
  "headerStatusUploaded": "Hochgeladen",
  "headerStatusUploading": "Hochladen..."
});
}

There been many article and questions on Kendo control localization, but could not find answer to this particular scenario.

1 Answer, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 13 Jun 2016, 06:56 AM
Hello Jayesh,

Review the following online help article: Culture Definition Customization

What you can do is create a custom culture file, which has the Belarus culture definitions, but Russian localization. For example kendo.culture.bl-RU.js.
(function(f){
    if (typeof define === 'function' && define.amd) {
        define(["kendo.core"], f);
    } else {
        f();
    }
}(function(){
(function( window, undefined ) {
    kendo.cultures["bl-RU"] = {
        name: "bl-RU",
...

Then set the culture property of the DatePicker to "bl-RU".
$("#datepicker").kendoDatePicker({
    culture: "bl-RU"
});

Regards,
Stanimir
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Asked by
Jayesh
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Share this question
or