intl-debug.js revision 628b3b052ecff4d1843c7e919951413fbc03e79f
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen DesaiYUI.add('intl-load', function(Y) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai /* Loader/MetaData Touch Points
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai a) _explodeLang()
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai 1) Explode static meta-data "lang" property into first class modules
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai var langModuleName = loader._formatLang(lang, module);
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai b) _useLang(lang)
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai Support for Y.use("lang:fr-CA"); or Y.use("lang:fr-CA;module");
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai 1) Y.Intl.lookupBestLang(module, lang)
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai 2) loader._formatLang(module, lang)
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai 3) loader.insert(module_lang)
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai 4) Y._attach(module_lang)
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai c) getAvailableLangs(module)
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai 1) Loop through meta-data for the module, to get available langs
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai getAvailableLangs() support feasible?
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai Loop through meta-data for all "loaded" modules, to get the common
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai subset (could be presented as an app level dropdown for example).
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai d) Register custom langs
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai 1). Same as any module?
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai */
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai/**
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * The Intl utility provides a central location for managing language specific sets of strings and formatting patterns.
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @module intl
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai */
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai/**
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * The intl-load sub-module provides utilities for loader language support
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai *
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @module intl
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @submodule intl-load
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai */
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai/**
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * The Intl utility provides a central location for managing language specific sets of strings and formatting patterns.
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai *
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @class Intl
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @static
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai */
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desaivar SPLIT_REGEX = /[, ]/;
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen DesaiY.mix(Y.namespace("Intl"), {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai /**
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * Finds the best language match, from the list of available languages based on BCP 47 lookup.
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai *
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @method lookupBestLang
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @param {String} lang The BCP 47 language tag to find the best match for
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @param {Array} supportedLangs An array of supported langauge codes
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai *
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @return {String} The BCP 47 language tag
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai */
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai lookupBestLang : function (preferredLanguages, availableLanguages) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai var i, language, result, index;
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai // check whether the list of available languages contains language; if so return it
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai function scan(language) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai var i;
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai for (i = 0; i < availableLanguages.length; i += 1) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai if (language.toLowerCase() === availableLanguages[i].toLowerCase()) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai return availableLanguages[i];
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai if (Y.Lang.isString(preferredLanguages)) {
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai preferredLanguages = preferredLanguages.split(SPLIT_REGEX);
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai for (i = 0; i < preferredLanguages.length; i += 1) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai language = preferredLanguages[i];
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai if (!language || language === "*") {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai continue;
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai // check the fallback sequence for one language
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai while (language.length > 0) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai result = scan(language);
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai if (result) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai return result;
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai } else {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai index = language.lastIndexOf("-");
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai if (index >= 0) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai language = language.substring(0, index);
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai // one-character subtags get cut along with the following subtag
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai if (index >= 2 && language.charAt(index - 2) === "-") {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai language = language.substring(0, index - 2);
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai } else {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai // nothing available for this language
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai break;
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai return "";
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai },
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai _explodeLang : function() {
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai // LOADER STUB
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai },
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai _useLang : function(module, lang) {
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai // LOADER STUB
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai },
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai getAvailableLangs : function(module) {
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai // META-DATA STUB
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai }
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai});
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai}, '@VERSION@' );
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen DesaiYUI.add('intl-lang', function(Y) {
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desaivar _mods = {},
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai ACTIVE = "yuiActiveLang";
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai/**
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * The intl-lang sub-module adds the ability to store and retrieve multiple sets of language strings on the client.
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai *
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @module intl
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @submodule intl-lang
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai */
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai/**
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * The Intl utility provides a central location for managing language specific sets of strings and formatting patterns.
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai *
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @class Intl
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @static
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai */
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen DesaiY.mix(Y.namespace("Intl"), {
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai /**
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @method _mod
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @private
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai *
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @param {String} module The name of the module
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @return {Object} The hash of localized strings for the module, keyed by BCP language tag
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai */
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai _mod : function(module) {
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai if (!_mods[module]) {
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai _mods[module] = {};
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai }
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai return _mods[module];
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai },
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai /**
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * Sets the active language for the given module.
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai *
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * Returns false on failure, which would happen if the language had not been registered through the <a href="#method_add">add()</a> method.
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai *
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @method setLang
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @private
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai *
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @param {String} module The module name.
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @param {String} lang The BCP 47 language tag.
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai */
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai _setLang : function(module, lang) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai var langs = this._mod(module),
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai currLang = langs[ACTIVE],
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai exists = !!langs[lang];
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai if (exists) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai langs[ACTIVE] = lang;
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai this.fire("intl:langChange", {module: module, prevVal: currLang, newVal: lang});
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai return exists;
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai },
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai /**
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * Get the active language for the given module.
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai *
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @method getLang
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai *
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @param {String} module The module name.
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @param {String} lang The BCP 47 language tag.
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai *
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @return {String} The current BCP 47 language tag.
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai */
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai getLang : function(module) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai return this._mod(module)[ACTIVE];
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai },
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai /**
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * Register a set of strings for the given module and language
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai *
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @method add
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai *
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @param {String} module The module name.
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @param {String} lang The BCP 47 language tag.
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @param {Object} strings The hash of strings.
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai */
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai add : function(module, lang, strings) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai this._mod(module)[lang] = strings;
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai this._setLang(module, lang);
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai },
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai /**
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * Get the module strings for the given BCP language tag.
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai *
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @method get
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai *
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @param {String} module The module name.
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @param {String} key Optional. If not provided, returns all strings, using merge to protect the originals.
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai * @param {String} lang Optional. The BCP 47 langauge tag.
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai * @return String | Object
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai */
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai get : function(module, key, lang) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai var mod = this._mod(module),
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai strs,
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai str;
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai lang = lang || mod[ACTIVE];
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai strs = mod[lang];
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai if (strs) {
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai str = (key) ? strs[key] : Y.merge(strs);
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai return str;
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai }
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai});
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen DesaiY.augment(Y.Intl, Y.EventTarget);
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen DesaiY.Intl.publish("intl:langChange", {emitFacade:true});
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai
d894ed8f7003b6c2ec19d5fb3969b6c45f0d7147Satyen Desai}, '@VERSION@' ,{requires:['event-custom']});
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen DesaiYUI.add('intl', function(Y){}, '@VERSION@' ,{use:['intl-load', 'intl-lang']});
628b3b052ecff4d1843c7e919951413fbc03e79fSatyen Desai