-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessages.js
24 lines (24 loc) · 915 Bytes
/
messages.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
define([], function(){
// module:
// mystique/messages
//
return {
load: function(id, require, callback){
if (require.micro) {
var jsonhttp = new XMLHttpRequest;
jsonhttp.onreadystatechange=function(){
if (jsonhttp.readyState==4 && jsonhttp.status==200) {
callback(JSON.parse(jsonhttp.responseText));
}
}
jsonhttp.open("GET", require.baseUrl + "../mystique-common/translations/messages.json",true);
jsonhttp.send();
} else {
//this is added to allow caching of messages strings in a dojo layer
require(['dojo/text!mystique-common/translations/messages.json'], function(messages){
callback(JSON.parse(messages));
})
}
}
};
});