fixed translator.load, it wasn't passing in language and was trying to
load undefined.json
v1.18.x
barisusakli 11 years ago
parent 093e373025
commit 8146358aac

@ -78,7 +78,7 @@ var ajaxify = ajaxify || {};
}, url, RELATIVE_PATH + '/' + url + hash);
}
translator.load(tpl_url);
translator.load(config.defaultLang, tpl_url);
$('#footer, #content').removeClass('hide').addClass('ajaxifying');
var animationDuration = parseFloat($('#content').css('transition-duration')) || 0.2,
@ -196,10 +196,9 @@ var ajaxify = ajaxify || {};
$(window).trigger('action:ajaxify.loadingData', {url: url});
if (ajaxify.preloader && ajaxify.preloader[url]) {
if (ajaxify.preloader && ajaxify.preloader[url] && !ajaxify.preloader[url].loading) {
callback(null, ajaxify.preloader[url].data);
ajaxify.preloader = {};
return;
}
@ -312,13 +311,16 @@ var ajaxify = ajaxify || {};
var url = this.href.replace(rootUrl + '/', ''),
currentTime = (new Date()).getTime();
if (!ajaxify.preloader[url] || currentTime - ajaxify.preloader[url].lastFetched > PRELOADER_RATE_LIMIT) {
ajaxify.preloader[url] = null;
if (!ajaxify.preloader[url] || (!ajaxify.preloader[url].loading && currentTime - ajaxify.preloader[url].lastFetched > PRELOADER_RATE_LIMIT)) {
ajaxify.preloader[url] = {
loading: true
};
ajaxify.loadData(url, function(err, data) {
ajaxify.preloader[url] = err ? null : {
url: url,
data: data,
lastFetched: currentTime
lastFetched: currentTime,
loading: false
};
});
}

@ -142,12 +142,11 @@
translator.compile = function() {
var args = Array.prototype.slice.call(arguments, 0);
return '[[' + args.join(', ') + ']]';
};
translator.load = function (language, filename, callback) {
if (isLanguageFileLoaded(language, filename)) {
if (callback) {
callback(languages[language].loaded[filename]);

Loading…
Cancel
Save