Fixed Issue 303

git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@3284 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
Denis Zgonjanin 2010-01-12 21:43:02 +00:00
parent 05d684bfea
commit 7de63cc745
4 changed files with 47 additions and 28 deletions

View File

@ -32,29 +32,6 @@ var hasProductInstall = DetectFlashVer(6, 0, 65);
// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
// Check locale
var localeChain = "en_US";
if (navigator.language)
localeChain = navigator.language;
else if (navigator.browserLanguage)
localeChain = navigator.browserLanguage;
if(/^([a-z]+)-([a-z]+)$/i.test(localeChain)){
var matches = /^([a-z]+)-([a-z]+)$/i.exec(localeChain);
localeChain = matches[1].toLowerCase() + "_" + matches[2].toUpperCase();
}
else if(/^([a-z]+)$/i.test(localeChain)){
var matches = /^([a-z]+)$/i.exec(localeChain);
localeChain = matches[1].toLowerCase();
}
else{
localeChain = "en_US";
}
var resourceModuleURLs = "locale/" + localeChain + "_resources.swf";
// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
if ( hasProductInstall && !hasRequestedVersion ) {
// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
@ -68,7 +45,7 @@ if ( hasProductInstall && !hasRequestedVersion ) {
AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"" + '&resourceModuleURLs='+resourceModuleURLs+'&localeChain='+localeChain,
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "${width}",
"height", "${height}",
"align", "middle",
@ -86,7 +63,6 @@ if ( hasProductInstall && !hasRequestedVersion ) {
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "${swf}",
"FlashVars", 'resourceModuleURLs='+resourceModuleURLs+'&localeChain='+localeChain,
"width", "${width}",
"height", "${height}",
"align", "middle",
@ -144,6 +120,30 @@ function checkForJava(){
return 1;
}
// Check locale
var localeChain = "en_US";
if (navigator.language)
localeChain = navigator.language;
else if (navigator.browserLanguage)
localeChain = navigator.browserLanguage;
if(/^([a-z]+)-([a-z]+)$/i.test(localeChain)){
var matches = /^([a-z]+)-([a-z]+)$/i.exec(localeChain);
localeChain = matches[1].toLowerCase() + "_" + matches[2].toUpperCase();
}
else if(/^([a-z]+)$/i.test(localeChain)){
var matches = /^([a-z]+)$/i.exec(localeChain);
localeChain = matches[1].toLowerCase();
}
else{
localeChain = "en_US";
}
function getLanguage(){
return localeChain;
}
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

View File

@ -25,7 +25,8 @@
xmlns:maps="org.bigbluebutton.main.maps.*"
xmlns:mate="http://mate.asfusion.com/"
pageTitle="Big Blue Button"
layout="absolute">
layout="absolute"
preloader="org.bigbluebutton.main.managers.BigBlueButtonPreloader">
<mx:Script>
<![CDATA[
import org.bigbluebutton.main.view.components.MainApplicationShell;

View File

@ -1,5 +1,8 @@
package org.bigbluebutton.main.managers
{
import flash.display.Sprite;
import mx.controls.Alert;
import mx.events.RSLEvent;
import mx.preloaders.DownloadProgressBar;
@ -11,8 +14,13 @@ package org.bigbluebutton.main.managers
{
super();
downloadingLabel = "Downloading BigBlueButton main...";
initializingLabel = "Initializing BigBlueButton...";
addEventListener(RSLEvent.RSL_ERROR, sharedLibraryLoadingFailed);
initializingLabel = "BigBlueButton starting...";
MINIMUM_DISPLAY_TIME = 0;
}
override public function set preloader(value:Sprite):void{
super.preloader = value;
value.addEventListener(RSLEvent.RSL_ERROR, sharedLibraryLoadingFailed);
}
private function sharedLibraryLoadingFailed(e:RSLEvent):void{

View File

@ -22,6 +22,7 @@ package org.bigbluebutton.util.i18n
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.IEventDispatcher;
import flash.external.ExternalInterface;
import mx.events.ResourceEvent;
import mx.resources.IResourceManager;
@ -46,6 +47,15 @@ package org.bigbluebutton.util.i18n
else {
// changeLocale(localeChain[0]);
}
resourceManager.localeChain = [ExternalInterface.call("getLanguage")];
var localeAvailable:Boolean = false;
for (var i:Number = 0; i<localeChain.length; i++){
if (resourceManager.localeChain[0] == localeChain[i]) localeAvailable = true;
}
if (!localeAvailable){
resourceManager.localeChain = [DEFAULT_LANGUAGE];
resourceManager.loadResourceModule('locale/' + DEFAULT_LANGUAGE + '_resources.swf', true);
}
}
public static function getInstance():ResourceUtil {