intl.js revision 30551f406370f7c8bf461a833205311de720886d
var _mods = {},
ROOT_LANG = "yuiRootLang",
ACTIVE_LANG = "yuiActiveLang";
/**
* The intl-lang sub-module adds the ability to store and retrieve multiple sets of language strings on the client.
*
* @module intl
* @submodule intl-lang
*/
/**
* The Intl utility provides a central location for managing language specific sets of strings and formatting patterns.
*
* @class Intl
* @static
*/
/**
* @method _mod
* @private
*
* @param {String} module The name of the module
* @return {Object} The hash of localized strings for the module, keyed by BCP language tag
*/
}
},
/**
* Sets the active language for the given module.
*
* Returns false on failure, which would happen if the language had not been registered through the <a href="#method_add">add()</a> method.
*
* @method setLang
* @private
*
* @param {String} module The module name.
* @param {String} lang The BCP 47 language tag.
*/
if (exists) {
this.fire("intl:langChange", {module: module, prevVal: currLang, newVal: (lang === ROOT_LANG) ? "" : lang});
}
return exists;
},
/**
* Get the active language for the given module.
*
* @method getLang
*
* @param {String} module The module name.
* @param {String} lang The BCP 47 language tag.
*
* @return {String} The current BCP 47 language tag.
*/
},
/**
* Register a set of strings for the given module and language
*
* @method add
*
* @param {String} module The module name.
* @param {String} lang The BCP 47 language tag.
* @param {Object} strings The hash of strings.
*/
},
/**
* Get the module strings for the given BCP language tag.
*
* @method get
*
* @param {String} module The module name.
* @param {String} key Optional. If not provided, returns a shallow cloned hash of all strings (to protect the originals).
* @param {String} lang Optional. The BCP 47 langauge tag.
* @return String | Object
*/
strs;
},
/**
* Obtains the list of languages for which resource bundles are available for a given module, based on the module
* meta-data (part of loader). If loader is not on the page, returns an empty array.
*
* @param {String} module The name of the module
* @return {Array} The list of languages available.
*/
getAvailableLangs : function(module) {
var availLangs = [],
lang;
// Y.Env.lang[lang][m.name]
if(allLangs) {
}
}
}
}
return availLangs;
}
});