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

Change Language

2 Answers 1092 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 3
Iron
Iron
Iron
Daniel asked on 11 Aug 2020, 09:28 AM

Hey,

all kendo widgets I'm using are set to German and all of them are working properly except for the PDFViewer. I set the localization like that for all the widgets:

<script>
    $(function () {
        kendo.culture("de-DE");
    })
</script>

 

But only the PDFViewer is in English. How can I change that?

 

- Daniel

2 Answers, 1 is accepted

Sort by
0
Accepted
Aleksandar
Telerik team
answered on 13 Aug 2020, 05:53 AM

Hello Daniel,

The reason for the PDFViewer not being translated is that translations are not available for every language and some of the localization files may be incomplete. Indeed this is the case for the PDFviewer. The full list of currently available translations is available in the Kendo UI Core repository.

To localize the PDFViewer you can either extend the messages file kendo.messages.de-DE.js or add the below script before the initialization of the PDFViewer. You can define translations for all properties in the messages configuration option:

if (kendo.ui.PDFViewer) {
            kendo.ui.PDFViewer.prototype.options.messages =
            $.extend(kendo.ui.PDFViewer.prototype.options.messages, {
                toolbar: {
                    pager: {
                        // Change the text of the properties below
                        "first": "Go to the first page",
                        "previous": "Go to the previous page",
                        "next": "Go to the next page",
                        "last": "Go to the last page",
                        "of": " von {0} ",
                        "page": "page",
                        "pages": "pages"
                    },
                  zoom: {
                        "zoomOut": "Custom Zoom Out",
                        "zoomIn": "Custom Zoom In",
                        "actualWidth": "Custom Actual Width",
                        "autoWidth": "Custom Automatic Width",
                        "fitToWidth": "Custom Fit to Width",
                        "fitToPage": "Custom Fit to Page"
                    }
                }
            });
        }

If you decide to update the localization files with German translations and decide to contribute to extending the translations you can follow the guidelines in this section.

Regards,
Aleksandar
Progress Telerik

0
Daniel
Top achievements
Rank 3
Iron
Iron
Iron
answered on 13 Aug 2020, 12:05 PM
Thank you! The right translation (regarding to existing parameters in other widgets) is looking like:

if (kendo.ui.PDFViewer) {
            kendo.ui.PDFViewer.prototype.options.messages =
                $.extend(kendo.ui.PDFViewer.prototype.options.messages, {
                    toolbar: {
                        pager: {
                            "first": "Zur ersten Seite",
                            "previous": "Zur vorherigen Seite",
                            "next": "Zur nächsten Seite",
                            "last": "Zur letzten Seite",
                            "of": " von {0} ",
                            "page": "Seite",
                            "pages": "Seiten"
                        },
                        zoom: {
                            "zoomOut": "Herauszoomen",
                            "zoomIn": "Hineinzoomen",
                            "actualWidth": "Tatsächliche Breite",
                            "autoWidth": "Automatische Breite",
                            "fitToWidth": "An Breite anpassen",
                            "fitToPage": "An Seite anpassen"
                        }
                    }
                });
        }


Maybe some day I will inform me how to contribute my translation to the localization files.

 

Regards
- Daniel



Tags
PDFViewer
Asked by
Daniel
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Aleksandar
Telerik team
Daniel
Top achievements
Rank 3
Iron
Iron
Iron
Share this question
or