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