From: Michael J. Rubinsky Date: Tue, 22 Dec 2009 16:56:34 +0000 (-0500) Subject: Pass configuration to setup the language for OL. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=1d779f7667c30c3f35a17baf1f0bbc4d87c926f0;p=horde.git Pass configuration to setup the language for OL. --- diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 8f29b92c3..3a4b5ebe6 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -115,9 +115,18 @@ class Kronolith { // Add the apikeys if (!empty($params['providers'])) { + /* It is safe to put configuration specific to horde driver inside + this block since horde driver *must* contain a provider array */ + + // Language specific file needed? + $language = str_replace('_', '-', $GLOBALS['language']); + if (!file_exists($GLOBALS['registry']->get('jsfs', 'horde') . '/hordemap/' . $language . '.js')) { + $language = 'en-US'; + } $params['conf'] = array( 'URI_IMG_HORDE' => $GLOBALS['registry']->getImageDir('horde') . '/', - 'useMarkerLayer' => true); + 'useMarkerLayer' => true, + 'language' => $language); foreach ($params['providers'] as $layer) { switch ($layer) { @@ -127,8 +136,6 @@ class Kronolith case 'Yahoo': $params['apikeys']['yahoo'] = $GLOBALS['conf']['api']['yahoomaps']; break; - //case 'Ve': - // none needed. case 'Cloudmade': $params['apikeys']['cloudemade'] = $GLOBALS['conf']['api']['cloudemade']; break; @@ -144,8 +151,6 @@ class Kronolith case 'Yahoo': $params['apikeys']['yahoo'] = $GLOBALS['conf']['api']['yahoomaps']; break; - //case 'Ve': - // none needed. case 'Cloudmade': $params['apikeys']['cloudemade'] = $GLOBALS['conf']['api']['cloudemade']; break;