From 1d779f7667c30c3f35a17baf1f0bbc4d87c926f0 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Tue, 22 Dec 2009 11:56:34 -0500 Subject: [PATCH] Pass configuration to setup the language for OL. --- kronolith/lib/Kronolith.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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; -- 2.11.0