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

Localization and require.js

3 Answers 60 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marcin
Top achievements
Rank 1
Veteran
Marcin asked on 22 Dec 2015, 12:56 PM

Could you please guide me how to use localization together with require js.

 Following code produces error:

 window.require(
            [
            "kendo/kendo.menu.min",
            "kendo/kendo.router.min",
            "kendo/kendo.notification.min",
            "kendo/kendo.window.min",
            "kendo/cultures/kendo.culture.en-GB.min",
            "kendo/messages/kendo.messages.en-GB.min"
            ], function() {
               
                window.kendo.culture("en-GB");

                console.log("culture", window.kendo.culture());              
            });

 The error is:

TypeError: kendo.ui is undefined Scripts/Kendo/messages/kendo.messages.en-GB.min.js?ver=1450788192741

Rest of config is working.

 

 

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 24 Dec 2015, 10:20 AM
Hello Marcin,

There is no kendo.messages.en-GB file. We do generate the cultures files from external resources which is why we have file for each culture. The same however is not possible for localization files - the localization files are community effort, Kendo Team keeps up to date only the en-US file which clients use as a reference to create their own localization files.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Marcin
Top achievements
Rank 1
Veteran
answered on 24 Dec 2015, 11:14 AM

Hi, lets I know there is no such original file. But my question was how to use messages file together with requirejs. It can be any messages file. Jus would like to know how to use it. 

 Regards

Marcin

0
Accepted
Alexander Valchev
Telerik team
answered on 24 Dec 2015, 12:46 PM
Hi Marcin,

In order to get this working you have to use nested RequireJS callbacks:

require.config({
    baseUrl: "../",
    paths: {
        // Specify the location of the jQuery JS file since it is loaded from the jQuery CDN
        "jquery": "http://code.jquery.com/jquery-1.9.1.min",
    }
});
 
require([ "src/kendo.binder", "src/kendo.combobox", "src/kendo.virtuallist" ], function(){
    require([ "src/cultures/kendo.culture.bg-BG", "src/messages/kendo.messages.bg-BG" ], function() {
        kendo.culture("bg-BG");
        console.log(kendo.culture());
    })
});


Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Marcin
Top achievements
Rank 1
Veteran
Answers by
Alexander Valchev
Telerik team
Marcin
Top achievements
Rank 1
Veteran
Share this question
or