r104610 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104609‎ | r104610 | r104611 >
Date:23:25, 29 November 2011
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
work on altitude support
Modified paths:
  • /trunk/extensions/SemanticMaps/SemanticMaps.i18n.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/SM_GeoCoordsValue.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/includes/SM_GeoCoordsValue.php
@@ -167,10 +167,18 @@
168168 global $smgQPCoodFormat, $smgQPCoodDirectional;
169169 $text = MapsCoordinateParser::formatCoordinates( $coordinateSet, $smgQPCoodFormat, $smgQPCoodDirectional );
170170
171 - return '<span class="smwttinline">' . htmlspecialchars( $text ) . '<span class="smwttcontent">' .
172 - htmlspecialchars ( wfMsgForContent( 'maps-latitude' ) . ' ' . $coordinateSet['lat'] ) . '<br />' .
173 - htmlspecialchars ( wfMsgForContent( 'maps-longitude' ) . ' ' . $coordinateSet['lon'] ) .
174 - '</span></span>';
 171+ $lines = array(
 172+ htmlspecialchars( wfMsgExt( 'semanticmaps-latitude', 'content', $coordinateSet['lat'] ) ),
 173+ htmlspecialchars( wfMsgExt( 'semanticmaps-longitude', 'content', $coordinateSet['lon'] ) ),
 174+ );
 175+
 176+ if ( array_key_exists( 'alt', $coordinateSet ) ) {
 177+ $lines[] = htmlspecialchars ( wfMsgForContent( 'semanticmaps-altitude', 'content', $coordinateSet['alt'] ) );
 178+ }
 179+
 180+ return '<span class="smwttinline">' . htmlspecialchars( $text ) . '<span class="smwttcontent">' .
 181+ implode( '<br />', $lines ) .
 182+ '</span></span>';
175183 } else {
176184 return $this->getErrorText();
177185 }
Index: trunk/extensions/SemanticMaps/SemanticMaps.i18n.php
@@ -22,6 +22,10 @@
2323 'semanticmaps-kml' => 'KML',
2424 'semanticmaps-default-kml-pagelink' => 'View page $1',
2525
 26+ 'semanticmaps-latitude' => 'Latitude: $1',
 27+ 'semanticmaps-longitude' => 'Longitude: $1',
 28+ 'semanticmaps-altitude' => 'Altitude: $1',
 29+
2630 // Forms
2731 'semanticmaps-loading-forminput' => 'Loading map form input...',
2832 'semanticmaps_lookupcoordinates' => 'Look up coordinates',

Comments

#Comment by Raymond (talk | contribs)   07:36, 30 November 2011

Please add message documentation for the newly added messages. Thanks.

#Comment by Nikerabbit (talk | contribs)   07:48, 2 December 2011

Why use both wfMsgExt and wfMsgForContent?