translator.getTranslations & bug fix

v1.18.x
psychobunny 10 years ago
parent 5ee0ed401f
commit 52cf224e5a

@ -21,6 +21,16 @@
languages[language].loading = languages[language].loading || {};
};
translator.getTranslations = function(language, filename, callback) {
if (languages[language] && languages[language].loaded[filename]) {
callback(languages[language].loaded[filename]);
} else {
translator.load(language, filename, function() {
callback(languages[language].loaded[filename]);
});
}
}
translator.getLanguage = function() {
return config.defaultLang;
};
@ -180,7 +190,7 @@
callback(translations);
}
while (languages[language].callbacks[filename] && languages[language].callbacks[filename].length) {
while (languages[language].callbacks && languages[language].callbacks[filename] && languages[language].callbacks[filename].length) {
languages[language].callbacks[filename].pop()(translations);
}

Loading…
Cancel
Save