r69029 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69028‎ | r69029 | r69030 >
Date:22:57, 4 July 2010
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
Changes for 0.6.4 - language support for OL
Modified paths:
  • /trunk/extensions/Maps/Maps.php (modified) (history)
  • /trunk/extensions/Maps/Services/OpenLayers/Maps_OpenLayersDispMap.php (modified) (history)
  • /trunk/extensions/Maps/Services/OpenLayers/Maps_OpenLayersDispPoint.php (modified) (history)
  • /trunk/extensions/Maps/Services/OpenLayers/OpenLayerFunctions.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Services/OpenLayers/Maps_OpenLayersDispPoint.php
@@ -31,7 +31,7 @@
3232 * @see MapsBaseMap::addSpecificMapHTML()
3333 */
3434 public function addSpecificMapHTML() {
35 - global $egMapsOpenLayersPrefix, $egOpenLayersOnThisPage;
 35+ global $egMapsOpenLayersPrefix, $egOpenLayersOnThisPage, $wgLang;
3636
3737 $layerItems = $this->mService->createLayersStringAndLoadDependencies( $this->layers );
3838
@@ -47,6 +47,8 @@
4848 wfMsg( 'maps-loading-map' )
4949 );
5050
 51+ $langCode = $wgLang->getCode();
 52+
5153 $this->parser->getOutput()->addHeadItem(
5254 Html::inlineScript( <<<EOT
5355 addOnloadHook(
@@ -58,7 +60,8 @@
5961 $this->zoom,
6062 [$layerItems],
6163 [$this->controls],
62 - [$this->markerString]
 64+ [$this->markerString],
 65+ '$langCode'
6366 );
6467 }
6568 );
Index: trunk/extensions/Maps/Services/OpenLayers/OpenLayerFunctions.js
@@ -11,8 +11,10 @@
1212 * Creates and initializes an OpenLayers map.
1313 * The resulting map is returned by the function but no further handling is required in most cases.
1414 */
15 -function initOpenLayer(mapName, lon, lat, zoom, mapTypes, controls, marker_data){
 15+function initOpenLayer( mapName, lon, lat, zoom, mapTypes, controls, marker_data, langCode ){
1616
 17+ OpenLayers.Lang.setCode( langCode );
 18+
1719 // Create a new OpenLayers map with without any controls on it.
1820 var mapOptions = {
1921 projection: new OpenLayers.Projection("EPSG:900913"),
@@ -167,5 +169,4 @@
168170 'minSize': new OpenLayers.Size(minWidth, minHeight)
169171 }
170172 );
171 -}
172 -
 173+}
\ No newline at end of file
Index: trunk/extensions/Maps/Services/OpenLayers/Maps_OpenLayersDispMap.php
@@ -24,7 +24,7 @@
2525 * @see MapsBaseMap::addSpecificMapHTML()
2626 */
2727 public function addSpecificMapHTML() {
28 - global $egMapsOpenLayersPrefix, $egOpenLayersOnThisPage;
 28+ global $egMapsOpenLayersPrefix, $egOpenLayersOnThisPage, $wgLang;
2929
3030 $layerItems = $this->mService->createLayersStringAndLoadDependencies( $this->layers );
3131
@@ -40,6 +40,8 @@
4141 wfMsg( 'maps-loading-map' )
4242 );
4343
 44+ $langCode = $wgLang->getCode();
 45+
4446 $this->parser->getOutput()->addHeadItem(
4547 Html::inlineScript( <<<EOT
4648 addOnloadHook(
@@ -51,7 +53,8 @@
5254 $this->zoom,
5355 [$layerItems],
5456 [$this->controls],
55 - []
 57+ [],
 58+ '$langCode'
5659 );
5760 }
5861 );
Index: trunk/extensions/Maps/Maps.php
@@ -33,7 +33,7 @@
3434 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>.';
3535 }
3636 else {
37 - define( 'Maps_VERSION', '0.6.4 a7' );
 37+ define( 'Maps_VERSION', '0.6.4 a8' );
3838
3939 // The different coordinate notations.
4040 define( 'Maps_COORDS_FLOAT', 'float' );

Comments

#Comment by Ævar Arnfjörð Bjarmason (talk | contribs)   23:05, 4 July 2010

This works for me (i.e. OL is now localized). But I'm pretty sure that has to be $wgContLang, not $wgLang due to caching concerns. Or maybe not.

Status & tagging log