Index: trunk/extensions/GeoData/CoordinatesParserFunction.php |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | } |
73 | 73 | |
74 | 74 | $this->addCategory( wfMessage( 'geodata-broken-tags-category' ) ); |
75 | | - $errorText = $status->getWikiText(); |
| 75 | + $errorText = $this->errorText( $status ); |
76 | 76 | if ( $errorText == '<>' ) { |
77 | 77 | // Error that doesn't require a message, |
78 | 78 | // can't think of a better way to pass this condition |
— | — | @@ -194,6 +194,22 @@ |
195 | 195 | } |
196 | 196 | $this->output->addCategory( $name, $this->parser->getTitle()->getText() ); |
197 | 197 | } |
| 198 | + |
| 199 | + /** |
| 200 | + * Returns wikitext of status error message in content language |
| 201 | + * |
| 202 | + * @param Status $s |
| 203 | + * @return String |
| 204 | + */ |
| 205 | + private function errorText( Status $s ) { |
| 206 | + $errors = array_merge( $s->getErrorsArray(), $s->getWarningsArray() ); |
| 207 | + if ( !count( $errors ) ) { |
| 208 | + return ''; |
| 209 | + } |
| 210 | + $err = $errors[0]; |
| 211 | + $message = array_shift( $err ); |
| 212 | + return wfMessage( $message )->params( $err )->inContentLanguage()->plain(); |
| 213 | + } |
198 | 214 | } |
199 | 215 | |
200 | 216 | class CoordinatesOutput { |
Index: trunk/extensions/GeoData/GeoData.i18n.php |
— | — | @@ -25,4 +25,8 @@ |
26 | 26 | 'geodata-limit-exceeded' => '$1 is a number', |
27 | 27 | 'geodata-broken-tags-category' => 'Name of the tracking category', |
28 | 28 | 'geodata-primary-coordinate' => 'Localised name of parameter that makes <nowiki>{{#coordinates:}}</nowiki> tag primary', |
| 29 | +); |
| 30 | + |
| 31 | +$messages['ru'] = array( |
| 32 | + 'geodata-multiple-primary' => '<nowiki>{{#coordinates:}}</nowiki>: нельзя иметь более одной первичной метки на странице', |
29 | 33 | ); |
\ No newline at end of file |