diff --git a/source/Ox/js/Locale.js b/source/Ox/js/Locale.js index 9895fd3f..62ab902a 100644 --- a/source/Ox/js/Locale.js +++ b/source/Ox/js/Locale.js @@ -16,7 +16,7 @@ Ox.setLocale Sets locale (locale[, url], callback) locale Locale (like 'de' or 'fr') - url URL of JSON file with additional translations + url one or more URLs of JSON file with additional translations callback Callback function success If true, locale has been set @*/ @@ -34,14 +34,19 @@ callback(true); } else { Ox.forEach(Ox.LOCALES, function(locales, module) { - if (Ox.load[module] && Ox.contains(locales, locale)) { + if ( + (!module || Ox.load[module]) + && Ox.contains(locales, locale) + ) { urls.push([ Ox.PATH + 'Ox' + (module ? '.' + module : '') + '/json/locale.' + locale + '.json' ]); } }); - url && urls.push([url]); + url && url.forEach(function(value) { + urls.push(Ox.makeArray(value)); + }); Ox.getJSON(urls, function(data) { urls.forEach(function(url) { Ox.extend(translations, data[url]);