added i18n, refactoring

This commit is contained in:
Bachir Soussi Chiadmi
2018-02-20 14:26:09 +01:00
parent b8ae4dc3db
commit 7d6ff629b5
11 changed files with 218 additions and 94 deletions
+4 -4
View File
@@ -50,7 +50,7 @@ module.exports = {
// console.log('onreadystatechange', xobj.readyState);
switch(xobj.readyState){
case 3:
console.log('loading');
// console.log('loading');
break;
case 4:
if (xobj.status === 200) {
@@ -66,12 +66,12 @@ module.exports = {
xobj.send(null);
},
onJSONLoaded(lc, json, callback){
console.log('onDBLoaded '+lc);
// console.log('onDBLoaded '+lc);
this.data[lc] = JSON.parse(json);
this.loaded_dbs ++;
//
if (this.loaded_dbs == this.langs.length) {
console.log('All db loaded : data', this.data);
// console.log('All db loaded : data', this.data);
this.parseByID(callback);
}
@@ -133,7 +133,7 @@ module.exports = {
this.data_strct[tid].from.push(id);
}else{
// if targets does not exists, the db has an issue, warn about that
console.log(`!! warning : ${tid} target id does not exists`);
// console.log(`!! warning : ${tid} target id does not exists`);
}
}
}