META-INF.resources.bower_components.cldrjs.src.core.set_available_bundles.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwebmp-globalize Show documentation
Show all versions of jwebmp-globalize Show documentation
The JWebSwing implementation for a full Globalization
define([
"../resource/get"
], function (resourceGet) {
/**
* setAvailableBundles( Cldr, json )
*
* @Cldr [Cldr class]
*
* @json resolved/unresolved cldr data.
*
* Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}.
*/
return function (Cldr, json) {
var bundle,
availableBundleMapQueue = Cldr._availableBundleMapQueue,
main = resourceGet(json, ["main"]);
if (main) {
for (bundle in main) {
if (main.hasOwnProperty(bundle) && bundle !== "root" &&
availableBundleMapQueue.indexOf(bundle) === -1) {
availableBundleMapQueue.push(bundle);
}
}
}
};
});