[fusion-commits] r1943 - in trunk/layers/MapGuide: . php
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Wed Oct 14 16:30:11 EDT 2009
Author: madair
Date: 2009-10-14 16:30:10 -0400 (Wed, 14 Oct 2009)
New Revision: 1943
Modified:
trunk/layers/MapGuide/MapGuide.js
trunk/layers/MapGuide/php/CreateSession.php
Log:
re #69: return the browser accept lang from CreateSession
Modified: trunk/layers/MapGuide/MapGuide.js
===================================================================
--- trunk/layers/MapGuide/MapGuide.js 2009-10-14 20:26:14 UTC (rev 1942)
+++ trunk/layers/MapGuide/MapGuide.js 2009-10-14 20:30:10 UTC (rev 1943)
@@ -132,6 +132,13 @@
var o;
eval('o='+xhr.responseText);
this.session[0] = o.sessionId;
+ var acceptLang = o.acceptLanguage.split(',');
+ //IE - en-ca,en-us;q=0.8,fr;q=0.5,fr-ca;q=0.3
+ for (var i=0; i<acceptLang.length; ++i) {
+ var locale = acceptLang[i].split(";");
+ Fusion.initializeLocale(locale[0]);
+ break;
+ }
this.triggerEvent(Fusion.Event.MAP_SESSION_CREATED);
}
},
Modified: trunk/layers/MapGuide/php/CreateSession.php
===================================================================
--- trunk/layers/MapGuide/php/CreateSession.php 2009-10-14 20:26:14 UTC (rev 1942)
+++ trunk/layers/MapGuide/php/CreateSession.php 2009-10-14 20:30:10 UTC (rev 1943)
@@ -42,6 +42,7 @@
$result = null;
$result->sessionId = $sessionId;
$result->userName = $username;
+ $result->acceptLanguage = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
echo var2json($result);
/* start a php session in the web tier as well, using same session id */
More information about the fusion-commits
mailing list