How to load kendo.messages.xx-xx.min.js files from local disk when localization

3 posts, 0 answers
  1. Nick
    Nick avatar
    9 posts
    Member since:
    Oct 2018

    Posted 26 Oct 2018 Link to this post

    I am trying to load the culture files(kendo.messages.xx-xx.min.js) from the local disk, is there a good way to do that?

    The method you provided is like following:
    var baseUrl = 'https://kendo.cdn.telerik.com/2018.3.1017/js/messages/kendo.messages.';
    $.getScript(baseUrl + "zh-CN.min.js", function () {
    kendo.ui.progress($("#grid"), false);
    CreateGrid();
    });

    I would like to load it like following, but it didn't work for me.
    $.getScript("../culture/zh-CN.min.js", function () {
    kendo.ui.progress($("#grid"), false);
    CreateGrid();
    });
  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 30 Oct 2018 Link to this post

    Hello Nick,

    You could take a look at the following links for more information about the getScript method and its limitations:  
    If the language will not be changed dynamically, you can load the script file directly on the page:
    <script src="kendo.messages.bg-BG.js"></script>

    Hope this helps.


    Regards,
    Konstantin Dikov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Nick
    Nick avatar
    9 posts
    Member since:
    Oct 2018

    Posted 30 Oct 2018 in reply to Konstantin Dikov Link to this post

    Hi Konstantin, this problem is solved. I added the script section dynamically. 

     

    var script = document.createElement('script');
    script.onload = function () {
        kendo.ui.progress($("#grid"), true);
        kendo.ui.progress($("#grid"), false);
        CreateGrid();
    };
    script.src = "../scripts/KendoLanguages/kendo.messages." + locale + ".min.js";

    if(document.head){
        document.head.appendChild(script);
    }

Back to Top