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

Missing translation(?)

8 Answers 661 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Tayger
Top achievements
Rank 1
Iron
Tayger asked on 17 Oct 2017, 09:37 PM

Hello 

I experienced some missing(?) translation using kendoDateTimePicker.

I have set these options:

<input id="datetimepicker" />
<script>
$("#datetimepicker").kendoDateTimePicker({
    culture: "de-DE",
    dateInput: true,
});
</script>

 

The option dateInput shows date/time/.... as text (help) inside the input field if it's empty, what is nice. Setting the culture to any German language country (probably a problem in all other non English countries too) the help text still appears in English. See attachment as it looks like with the sample code above. Inside the calendar datepicker window the translation (in that case German) is set and correct.

It's not a big issue and I don't know if that is wanted or just overseen doing the translations.

Regards

 

 

 

8 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 19 Oct 2017, 07:55 AM
Hello, Farai,

I can assume that the issue occurs as these messages are coming from the DateInput which is a new widget and all of the translations are not added.

The messages files are community driven. Please check the following article demonstrating how they can be modified:

http://docs.telerik.com/kendo-ui/framework/localization/overview#contribution

I can suggest the following article demonstrating how the messages can be changed or extended:

http://docs.telerik.com/aspnet-mvc/getting-started/localization#localization

Also, I can suggest submitting a feature request, which will allow setting the messages, similar to the DateInput widget:

https://docs.telerik.com/kendo-ui/api/javascript/ui/dateinput#configuration-messages

http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/category/170289-date-time-editors

I hope this will help to add the missing messages.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tayger
Top achievements
Rank 1
Iron
answered on 03 Dec 2017, 12:11 PM

Hello

I tried to find out how it should work but I can't. I went through the links you offered but none explains how to proceed. On the one hand there are a lot of message files here: https://github.com/telerik/kendo-ui-core/tree/master/src/messages (not minified)

On the other hand there are a lot of message files in .../telerik/js/messages (but all minifed). I assume they kinda same files have to be brought together (the provided link speaks about "synchronize"). Or can I just replace the ones with the others (tough one is not minifed)?

Regards

0
Tayger
Top achievements
Rank 1
Iron
answered on 03 Dec 2017, 12:25 PM

Furthermore I checked some files at and would have expected there are conditions like 

if (kendo.ui.DateInput) {...

but there is not. The message files in ../Telerik/js/messages all have day/month/year... defintions in it. Would it not be obvious Telerik would use them for the DateInput placeholder mask? 

0
Stefan
Telerik team
answered on 05 Dec 2017, 01:06 PM
Hello, Farai,

Only the en-US culture have messages for all widgets.

/* DateInput */
if (kendo.ui.DateInput) {
  kendo.ui.DateInput.prototype.options.messages =
    $.extend(true, kendo.ui.DateInput.prototype.options.messages, {
      "year": "year",
      "month": "month",
      "day": "day",
      "weekday": "day of the week",
      "hour": "hours",
      "minute": "minutes",
      "second": "seconds",
      "dayperiod": "AM/PM"
    });
}

If the used culture is de-DE, then in the kendo.messages.de-DE file the following code should be added:

/* DateInput */
if (kendo.ui.DateInput) {
  kendo.ui.DateInput.prototype.options.messages =
    $.extend(true, kendo.ui.DateInput.prototype.options.messages, {
      "year": Message in Deutsch,
      "month": Message in Deutsch,",
      "day": Message in Deutsch,,
      "weekday": Message in Deutsch,,
      "hour": Message in Deutsch,,
      "minute": Message in Deutsch,,
      "second": Message in Deutsch,,
      "dayperiod": Message in Deutsch,
    });
}

The changes should be made on the non-minified version, which can be minified with external minificator.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tayger
Top achievements
Rank 1
Iron
answered on 17 Dec 2017, 02:33 PM

This seems to be a tough task to make it work. I've tried several things but dateInput always appears in English. Please let me know where I'm doing something wrong while trying to add German to the de-DE culture for the dateInput:

1. I make sure I'm using the correct culture in the code of my project (in my case German):

...
<script src="../telerik/js/cultures/kendo.culture.de-DE.min.js"></script>
...

 

2. The file that comes closest to your explanation is kendo.messages.de-DE.min.js.map (has exactly the "if (Widget)..." structure) and NOT kendo.messages.de-DE.min.js (HTML only, no Javascript found), both files located in .../telerik/js/message.

3. I take code from file kendo.messages.de-DE.js found on https://github.com/telerik/kendo-ui-core/tree/master/src/messages and add the code above from you into this file.

4. I let it minify, f.e. https://www.willpeavy.com/minifier/ and copy my file 'kendo.messages.de-DE.min.js.map' to /telerik/js/message (replaces the one there).

The only thing that confuses me: My new file (minified) has a size of 17KB while the original file kendo.messages.de-DE.min.js.map has a size of 39KB. The original file 'kendo.messages.de-DE.min.js' has a size of 18KB that comes way closer to my created file.
So I also have replaced kendo.messages.de-DE.min.js with my created file (.map file restored of course) to make sure this might be the problem but still taking English text in dateInput.

Do you see what I did wrong? Btw. I'm working with the licensed version. Maybe this all works only with the free Core version(?).

 

 

0
Tayger
Top achievements
Rank 1
Iron
answered on 17 Dec 2017, 04:35 PM

I guess I screwed it up with kendo.messages.de-DE.min.js and kendo.messages.de-DE.min.js.map. So I'm pretty sure I have to enhance the file 'kendo.messages.de-DE.min.js' located at .../telerik/js/messages. Whatever I did the KendoUi framework did not switch to any other language! I have created a working example showing a kendo editor. I would expect that the tooltips and also text behind certain buttons (insert link, insert image, ...) would appear in German. If you let run the following sample you stil will all see in English. So the default ('en-US') will be taken. I'm pretty sure I did something wrong or forgot something.

<!DOCTYPE html>
<html>
<head>
    <title></title>
 
</head>
<body>
 
    <script type="text/javascript">
        $(document).ready(function() {
            kendo.culture("de-DE");
 
            $("#editor").kendoEditor({});
        });
    </script>
 
    <div>
        <textarea id="editor"></textarea>
    </div>
 
</body>
</html>

 

 

xx

0
Stefan
Telerik team
answered on 19 Dec 2017, 11:36 AM
Hello, Farai,

The provided example is loading the culture files instead of the messages file. The culture file is responsible for formatting of the dates and the values. The messages file is responsible for the messages.

Once I loaded the messages file the tooltip messages were translated(except) the "Format" DropDown:

http://dojo.telerik.com/OCopa

In your scenario, the kendo.messages.de-DE.js has to be changed in the demonstrated way in the previous reply. Then it could be minified using an external minifier.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tayger
Top achievements
Rank 1
Iron
answered on 02 Jan 2018, 08:06 PM
In the end I was able to manage it, thanks for your help, very appreciated!
Tags
Date/Time Pickers
Asked by
Tayger
Top achievements
Rank 1
Iron
Answers by
Stefan
Telerik team
Tayger
Top achievements
Rank 1
Iron
Share this question
or