From bacb88c280af6de297576654c96af13b0c6b65bd Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Wed, 11 Jan 2012 17:00:43 +0000 Subject: [PATCH] - adding more logs to trace why some times we get the old locale error --- .../src/org/bigbluebutton/util/i18n/ResourceUtil.as | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/util/i18n/ResourceUtil.as b/bigbluebutton-client/src/org/bigbluebutton/util/i18n/ResourceUtil.as index 4d7fd9befa..d6ed2075c9 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/util/i18n/ResourceUtil.as +++ b/bigbluebutton-client/src/org/bigbluebutton/util/i18n/ResourceUtil.as @@ -79,9 +79,11 @@ package org.bigbluebutton.util.i18n private function handleComplete(e:Event):void{ parse(new XML(e.target.data)); - - loadMasterLocale(MASTER_LOCALE); + preferredLocale = getDefaultLocale(); + if (preferredLocale != MASTER_LOCALE) { + loadMasterLocale(MASTER_LOCALE); + } setPreferredLocale(preferredLocale); } @@ -140,9 +142,11 @@ package org.bigbluebutton.util.i18n } private function loadResource(language:String):IEventDispatcher { - // Add a random string on the query so that we don't get a cached version. + // Add a random string on the query so that we don't get a cached version. + var date:Date = new Date(); var localeURI:String = 'locale/' + language + '_resources.swf?a=' + date.time; + LogUtil.debug("Loading locale at [ " + localeURI + " ]"); return resourceManager.loadResourceModule(localeURI, false); } @@ -184,6 +188,7 @@ package org.bigbluebutton.util.i18n * @param event */ private function handleResourceNotLoaded(event:ResourceEvent):void{ + LogUtil.warn("Resource locale [" + preferredLocale + "] could not be loaded."); resourceManager.localeChain = [MASTER_LOCALE]; preferredLocale = MASTER_LOCALE; localeIndex = getIndexForLocale(preferredLocale); @@ -204,7 +209,7 @@ package org.bigbluebutton.util.i18n * (ralam dec 15, 2011). */ var localeTxt:String = resourceManager.getString(BBB_RESOURCE_BUNDLE, resourceName, parameters, null); - if (localeTxt == "") { + if ((localeTxt == "") || (localeTxt == null)) { localeTxt = resourceManager.getString(BBB_RESOURCE_BUNDLE, resourceName, parameters, MASTER_LOCALE); } return localeTxt;