ej.base.setCulture('ar-AE'); var ajax = new ej.base.Ajax('/src/pt.json', 'GET', true); ajax.onSuccess = function (value) { //Assigning locale text value for Essential JS 2 components ej.base.L10n.load(value); }; ajax.send();
loadCultureFiles('pt');
ej.base.setCulture('pt');
function loadCultureFiles(name) {
var files = ['ca-gregorian.json', 'numbers.json', 'timeZoneNames.json'];
var loader = ej.base.loadCldr;
var loadCulture = function (prop) {
var request = new XMLHttpRequest();
request.responseType = "json";
request.open("GET", "https://localhost:44371/cldr-data/main/pt/" + files[prop], true);
request.onload = function () {
if (this.readyState == 4 && this.status == 200) {
loader(request.response);
}
};
request.send();
};
for (var prop = 0; prop < files.length; prop++) {
loadCulture(prop);
}
}
|