improved check to see if a module is present

This commit is contained in:
rolux 2013-05-09 19:07:54 +02:00
parent ad4603ddb4
commit 1e056171e6

View file

@ -19,14 +19,14 @@
callback = arguments[1]; callback = arguments[1];
url = null; url = null;
} }
if (locale != Ox.LOCALE && isValidLocale) { if (isValidLocale) {
Ox.LOCALE = locale; Ox.LOCALE = locale;
if (locale == 'en') { if (locale == 'en') {
translations = {}; translations = {};
callback(true); callback(true);
} else { } else {
Ox.forEach(Ox.LOCALES, function(locales, module) { Ox.forEach(Ox.LOCALES, function(locales, module) {
if (Ox[module] && Ox.contains(locales, locale)) { if (Ox.load[module] && Ox.contains(locales, locale)) {
urls.push([ urls.push([
Ox.PATH + 'Ox' + (module ? '.' + module : '') Ox.PATH + 'Ox' + (module ? '.' + module : '')
+ '/json/locale.' + locale + '.json' + '/json/locale.' + locale + '.json'
@ -42,7 +42,7 @@
}); });
} }
} else { } else {
callback(isValidLocale); callback(false);
} }
}; };