Index: trunk/extensions/Maps/Maps.i18n.namespaces.php |
— | — | @@ -0,0 +1,14 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +$namespaceNames = array(); |
| 5 | + |
| 6 | +// For wikis without LiquidThreads installed. |
| 7 | +if ( ! defined('Maps_NS_LAYER') ) { |
| 8 | + define( 'Maps_NS_LAYER', 420 ); |
| 9 | + define( 'Maps_NS_LAYER_TALK', 421 ); |
| 10 | +} |
| 11 | + |
| 12 | +$namespaceNames['en'] = array( |
| 13 | + Maps_NS_LAYER => 'Layer', |
| 14 | + Maps_NS_LAYER_TALK => 'Layer_talk', |
| 15 | +); |
Property changes on: trunk/extensions/Maps/Maps.i18n.namespaces.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 16 | + native |
Index: trunk/extensions/Maps/Maps.i18n.php |
— | — | @@ -24,6 +24,7 @@ |
25 | 25 | 'maps-load-failed' => 'Could not load the map!', |
26 | 26 | 'maps-markers' => 'Markers', |
27 | 27 | 'maps-others' => 'others', |
| 28 | + //TODO: move to namespaces i18n |
28 | 29 | 'maps-ns-layer' => 'Layer', |
29 | 30 | 'maps-ns-layer-talk' => 'Layer talk', |
30 | 31 | 'maps-layer-property' => 'Property', |
Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -141,8 +141,8 @@ |
142 | 142 | $wgAPIModules['geocode'] = 'ApiGeocode'; |
143 | 143 | |
144 | 144 | $wgExtensionMessagesFiles['MapsMagic'] = $egMapsDir . 'Maps.i18n.magic.php'; |
145 | | - |
146 | 145 | $wgExtensionMessagesFiles['Maps'] = $egMapsDir . 'Maps.i18n.php'; |
| 146 | +$wgExtensionMessagesFiles['MapsNamespaces'] = $egMapsDir . 'Maps.i18n.namespaces.php'; |
147 | 147 | |
148 | 148 | // Register the initialization function of Maps. |
149 | 149 | $wgExtensionFunctions[] = 'efMapsSetup'; |
— | — | @@ -159,6 +159,9 @@ |
160 | 160 | // Since 1.0 |
161 | 161 | $wgHooks['MakeGlobalVariablesScript'][] = 'MapsHooks::onMakeGlobalVariablesScript'; |
162 | 162 | |
| 163 | +// Since ?? |
| 164 | +$wgHooks['CanonicalNamespaces'][] = 'MapsHooks::onCanonicalNamespaces'; |
| 165 | + |
163 | 166 | $egMapsFeatures = array(); |
164 | 167 | |
165 | 168 | $egMapsFeatures['pf'][] = 'MapsDisplayMap::initialize'; |
— | — | @@ -291,22 +294,6 @@ |
292 | 295 | * @return true |
293 | 296 | */ |
294 | 297 | function efMapsSetup() { |
295 | | - global $wgExtraNamespaces, $wgNamespaceAliases; |
296 | | - |
297 | | - if ( is_null( $wgExtraNamespaces ) ) { |
298 | | - $wgExtraNamespaces = array(); |
299 | | - } |
300 | | - |
301 | | - $wgExtraNamespaces += array( |
302 | | - Maps_NS_LAYER => 'Layer', |
303 | | - Maps_NS_LAYER_TALK => 'Layer talk' |
304 | | - ); |
305 | | - |
306 | | - $wgNamespaceAliases += array( |
307 | | - wfMsg( 'maps-ns-layer' ) => Maps_NS_LAYER, |
308 | | - wfMsg( 'maps-ns-layer-talk' ) => Maps_NS_LAYER_TALK |
309 | | - ); |
310 | | - |
311 | 298 | wfRunHooks( 'MappingServiceLoad' ); |
312 | 299 | wfRunHooks( 'MappingFeatureLoad' ); |
313 | 300 | |
Index: trunk/extensions/Maps/Maps.hooks.php |
— | — | @@ -84,4 +84,10 @@ |
85 | 85 | return true; |
86 | 86 | } |
87 | 87 | |
| 88 | + |
| 89 | + public static function onCanonicalNamespaces( &$list ) { |
| 90 | + $list[Maps_NS_LAYER] = 'Layer'; |
| 91 | + $list[Maps_NS_LAYER_TALK] = 'Layer_talk'; |
| 92 | + return true; |
| 93 | + } |
88 | 94 | } |