http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69029

Revision: 69029
Author:   jeroendedauw
Date:     2010-07-04 22:57:41 +0000 (Sun, 04 Jul 2010)

Log Message:
-----------
Changes for 0.6.4 - language support for OL

Modified Paths:
--------------
    trunk/extensions/Maps/Maps.php
    trunk/extensions/Maps/Services/OpenLayers/Maps_OpenLayersDispMap.php
    trunk/extensions/Maps/Services/OpenLayers/Maps_OpenLayersDispPoint.php
    trunk/extensions/Maps/Services/OpenLayers/OpenLayerFunctions.js

Modified: trunk/extensions/Maps/Maps.php
===================================================================
--- trunk/extensions/Maps/Maps.php      2010-07-04 22:24:11 UTC (rev 69028)
+++ trunk/extensions/Maps/Maps.php      2010-07-04 22:57:41 UTC (rev 69029)
@@ -33,7 +33,7 @@
        echo '<b>Warning:</b> You need to have <a 
href="http://www.mediawiki.org/wiki/Extension:Validator";>Validator</a> 
installed in order to use <a 
href="http://www.mediawiki.org/wiki/Extension:Maps";>Maps</a>.';
 }
 else {
-       define( 'Maps_VERSION', '0.6.4 a7' );
+       define( 'Maps_VERSION', '0.6.4 a8' );
 
        // The different coordinate notations.
        define( 'Maps_COORDS_FLOAT', 'float' );

Modified: trunk/extensions/Maps/Services/OpenLayers/Maps_OpenLayersDispMap.php
===================================================================
--- trunk/extensions/Maps/Services/OpenLayers/Maps_OpenLayersDispMap.php        
2010-07-04 22:24:11 UTC (rev 69028)
+++ trunk/extensions/Maps/Services/OpenLayers/Maps_OpenLayersDispMap.php        
2010-07-04 22:57:41 UTC (rev 69029)
@@ -24,7 +24,7 @@
         * @see MapsBaseMap::addSpecificMapHTML()
         */
        public function addSpecificMapHTML() {
-               global $egMapsOpenLayersPrefix, $egOpenLayersOnThisPage;
+               global $egMapsOpenLayersPrefix, $egOpenLayersOnThisPage, 
$wgLang;
                
                $layerItems = 
$this->mService->createLayersStringAndLoadDependencies( $this->layers );
 
@@ -40,6 +40,8 @@
                        wfMsg( 'maps-loading-map' )
                );
                
+               $langCode = $wgLang->getCode();
+               
                $this->parser->getOutput()->addHeadItem(
                        Html::inlineScript( <<<EOT
 addOnloadHook(
@@ -51,7 +53,8 @@
                        $this->zoom,
                        [$layerItems],
                        [$this->controls],
-                       []
+                       [],
+                       '$langCode'
                );
        }
 );

Modified: trunk/extensions/Maps/Services/OpenLayers/Maps_OpenLayersDispPoint.php
===================================================================
--- trunk/extensions/Maps/Services/OpenLayers/Maps_OpenLayersDispPoint.php      
2010-07-04 22:24:11 UTC (rev 69028)
+++ trunk/extensions/Maps/Services/OpenLayers/Maps_OpenLayersDispPoint.php      
2010-07-04 22:57:41 UTC (rev 69029)
@@ -31,7 +31,7 @@
         * @see MapsBaseMap::addSpecificMapHTML()
         */
        public function addSpecificMapHTML() {
-               global $egMapsOpenLayersPrefix, $egOpenLayersOnThisPage;
+               global $egMapsOpenLayersPrefix, $egOpenLayersOnThisPage, 
$wgLang;
                
                $layerItems = 
$this->mService->createLayersStringAndLoadDependencies( $this->layers );
                
@@ -47,6 +47,8 @@
                        wfMsg( 'maps-loading-map' )
                );
                
+               $langCode = $wgLang->getCode();
+               
                $this->parser->getOutput()->addHeadItem(
                        Html::inlineScript( <<<EOT
 addOnloadHook(
@@ -58,7 +60,8 @@
                        $this->zoom,
                        [$layerItems],
                        [$this->controls],
-                       [$this->markerString]
+                       [$this->markerString],
+                       '$langCode'
                );
        }
 );

Modified: trunk/extensions/Maps/Services/OpenLayers/OpenLayerFunctions.js
===================================================================
--- trunk/extensions/Maps/Services/OpenLayers/OpenLayerFunctions.js     
2010-07-04 22:24:11 UTC (rev 69028)
+++ trunk/extensions/Maps/Services/OpenLayers/OpenLayerFunctions.js     
2010-07-04 22:57:41 UTC (rev 69029)
@@ -11,8 +11,10 @@
  * Creates and initializes an OpenLayers map. 
  * The resulting map is returned by the function but no further handling is 
required in most cases.
  */
-function initOpenLayer(mapName, lon, lat, zoom, mapTypes, controls, 
marker_data){
+function initOpenLayer( mapName, lon, lat, zoom, mapTypes, controls, 
marker_data, langCode ){
 
+       OpenLayers.Lang.setCode( langCode );
+       
        // Create a new OpenLayers map with without any controls on it.
        var mapOptions =        { 
                                    projection: new 
OpenLayers.Projection("EPSG:900913"),
@@ -167,5 +169,4 @@
                        'minSize': new OpenLayers.Size(minWidth, minHeight)
                }
        );
-}
-
+}
\ No newline at end of file



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to