Index: trunk/extensions/Maps/Maps.i18n.php |
— | — | @@ -21,12 +21,20 @@ |
22 | 22 | Available mapping services: $1", |
23 | 23 | 'maps_map' => 'Map', |
24 | 24 | |
| 25 | + // Coordinate handling |
| 26 | + 'maps-abb-north' => 'N', |
| 27 | + 'maps-abb-east' => 'E', |
| 28 | + 'maps-abb-south' => 'S', |
| 29 | + 'maps-abb-west' => 'W', |
| 30 | + 'maps-latitude' => 'Latitude:', |
| 31 | + 'maps-longitude' => 'Longitude:', |
| 32 | + |
25 | 33 | // Coordinate errors |
26 | 34 | 'maps_coordinates_missing' => 'No coordinates provided for the map.', |
27 | 35 | 'maps_geocoding_failed' => 'The following {{PLURAL:$2|address|addresses}} could not be geocoded: $1.', |
28 | 36 | 'maps_geocoding_failed_for' => 'The following {{PLURAL:$2|address|addresses}} could not be geocoded and {{PLURAL:$2|has|have}} been omitted from the map: |
29 | 37 | $1', |
30 | | - 'maps_unrecognized_coords' => 'The following coordinates were not recognized: $1.', |
| 38 | + 'maps_unrecognized_coords' => 'The following {{PLURAL:$2|coordinate was|coordinates were}} not recognized: $1.', |
31 | 39 | 'maps_unrecognized_coords_for' => 'The following {{PLURAL:$2|coordinate was|coordinates were}} not recognized and {{PLURAL:$2|has|have}} been omitted from the map: |
32 | 40 | $1', |
33 | 41 | 'maps_map_cannot_be_displayed' => 'The map cannot be displayed.', |
Index: trunk/extensions/Maps/Maps_CoordinateParser.php |
— | — | @@ -56,12 +56,22 @@ |
57 | 57 | public static function formatCoordinates( $coordinates, $targetType = COORDS_FLOAT, $directional = false ) { |
58 | 58 | $coordinates = trim( $coordinates ); |
59 | 59 | |
| 60 | + /* |
| 61 | + |
| 62 | + $value = str_replace( array( '°', '°' ), '°', $value ); |
| 63 | + $value = str_replace( array( '´', '´' ), '´', $value ); |
| 64 | + $value = str_replace( array( '″', '″', "''", '"', '´´', SM_GEO_MIN . SM_GEO_MIN ), SM_GEO_SEC, $value ); |
| 65 | + $value = str_replace( array( '′', '′', "'", '´' ), SM_GEO_MIN, $value ); |
| 66 | + |
| 67 | + */ |
| 68 | + |
60 | 69 | $coordinates = self::handleI18nLabels( $coordinates ); |
61 | 70 | |
62 | 71 | $coordsType = self::getCoordinatesType( $coordinates ); |
63 | 72 | |
64 | 73 | // If getCoordinatesType returned false, the provided value is invalid. |
65 | 74 | if ( $coordsType === false ) { |
| 75 | + die('WUHA'); |
66 | 76 | return false; |
67 | 77 | } |
68 | 78 | |
— | — | @@ -197,14 +207,14 @@ |
198 | 208 | */ |
199 | 209 | private static function handleI18nLabels( $coordinates ) { |
200 | 210 | self::initializeDirectionLabels(); |
201 | | - $coordinates = str_replace( self::$mI18nDirections, self::$mDirections, $coordinates ); |
| 211 | + return str_replace( self::$mI18nDirections, self::$mDirections, $coordinates ); |
202 | 212 | } |
203 | 213 | |
204 | 214 | /** |
205 | 215 | * Initialize the cache for internationalized direction labels if not done yet. |
206 | 216 | */ |
207 | 217 | private static function initializeDirectionLabels() { |
208 | | - if ( !$this->mI18nDirections ) { |
| 218 | + if ( !self::$mI18nDirections ) { |
209 | 219 | self::$mI18nDirections = array( |
210 | 220 | 'N' => wfMsgForContent( 'maps-abb-north' ), |
211 | 221 | 'E' => wfMsgForContent( 'maps-abb-east' ), |