From 7de63cc74584fdc0cca15655b3af8e96d53f54f2 Mon Sep 17 00:00:00 2001 From: Denis Zgonjanin Date: Tue, 12 Jan 2010 21:43:02 +0000 Subject: [PATCH] Fixed Issue 303 git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@3284 af16638f-c34d-0410-8cfa-b39d5352b314 --- .../html-template/index.template.html | 50 +++++++++---------- bigbluebutton-client/src/BigBlueButton.mxml | 3 +- .../main/managers/BigBlueButtonPreloader.as | 12 ++++- .../bigbluebutton/util/i18n/ResourceUtil.as | 10 ++++ 4 files changed, 47 insertions(+), 28 deletions(-) diff --git a/bigbluebutton-client/html-template/index.template.html b/bigbluebutton-client/html-template/index.template.html index b67fbd754f..538fc27d68 100644 --- a/bigbluebutton-client/html-template/index.template.html +++ b/bigbluebutton-client/html-template/index.template.html @@ -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; +} +