[fusion-commits] r1942 - in trunk/layers/MapServer: . php
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Wed Oct 14 16:26:17 EDT 2009
Author: madair
Date: 2009-10-14 16:26:14 -0400 (Wed, 14 Oct 2009)
New Revision: 1942
Modified:
trunk/layers/MapServer/MapServer.js
trunk/layers/MapServer/php/CreateSession.php
Log:
re #69: return the browser accept lang from CreateSession
Modified: trunk/layers/MapServer/MapServer.js
===================================================================
--- trunk/layers/MapServer/MapServer.js 2009-10-14 15:06:39 UTC (rev 1941)
+++ trunk/layers/MapServer/MapServer.js 2009-10-14 20:26:14 UTC (rev 1942)
@@ -109,6 +109,14 @@
var o;
eval('o='+r.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
+ //FF - en-us,en;q=0.5
+ 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/MapServer/php/CreateSession.php
===================================================================
--- trunk/layers/MapServer/php/CreateSession.php 2009-10-14 15:06:39 UTC (rev 1941)
+++ trunk/layers/MapServer/php/CreateSession.php 2009-10-14 20:26:14 UTC (rev 1942)
@@ -41,5 +41,6 @@
$result = null;
$result->sessionId = $sessionId;
$result->userName = '';
+$result->acceptLanguage = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
echo var2json($result);
?>
More information about the fusion-commits
mailing list