/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 3.3.0 build: 3167 */ YUI.add('widget-locale',function(Y){var TRUE=true,LOCALE="locale",INIT_VALUE="initValue",HYPHEN="-",EMPTY_STR="",Widget=Y.Widget;Widget.ATTRS[LOCALE]={value:"en"};Widget.ATTRS.strings.lazyAdd=false;Y.mix(Widget.prototype,{_setStrings:function(strings,locale){var strs=this._strs;locale=locale.toLowerCase();if(!strs[locale]){strs[locale]={};} Y.aggregate(strs[locale],strings,TRUE);return strs[locale];},_getStrings:function(locale){return this._strs[locale.toLowerCase()];},getStrings:function(locale){locale=(locale||this.get(LOCALE)).toLowerCase();var defLocale=this.getDefaultLocale().toLowerCase(),defStrs=this._getStrings(defLocale),strs=(defStrs)?Y.merge(defStrs):{},localeSegments=locale.split(HYPHEN),localeStrs,i,l,lookup;if(locale!==defLocale||localeSegments.length>1){lookup=EMPTY_STR;for(i=0,l=localeSegments.length;i