Index: trunk/extensions/GeoData/CoordinatesParserFunction.php |
— | — | @@ -101,14 +101,14 @@ |
102 | 102 | * @return Status: whether save went OK |
103 | 103 | */ |
104 | 104 | private function applyCoord( Coord $coord ) { |
105 | | - global $wgMaxCoordinatesPerPage; |
| 105 | + global $wgMaxCoordinatesPerPage, $wgContLang; |
106 | 106 | $geoData = $this->output->geoData; |
107 | 107 | if ( $geoData->getCount() >= $wgMaxCoordinatesPerPage ) { |
108 | 108 | if ( $geoData->limitExceeded ) { |
109 | 109 | return Status::newFatal( '' ); |
110 | 110 | } |
111 | 111 | $geoData->limitExceeded = true; |
112 | | - return Status::newFatal( 'geodata-limit-exceeded' ); |
| 112 | + return Status::newFatal( 'geodata-limit-exceeded', $wgContLang->formatNum( $wgMaxCoordinatesPerPage ) ); |
113 | 113 | } |
114 | 114 | if ( $coord->primary ) { |
115 | 115 | if ( $geoData->getPrimary() ) { |
Index: trunk/extensions/GeoData/GeoData.i18n.magic.php |
— | — | @@ -0,0 +1,14 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +$magicWords = array(); |
| 5 | + |
| 6 | +/** |
| 7 | + * English |
| 8 | + */ |
| 9 | + |
| 10 | +$magicWords = array(); |
| 11 | + |
| 12 | +/** English (English) */ |
| 13 | +$magicWords['en'] = array( |
| 14 | + 'coordinates' => array( 0, 'coordinates' ), |
| 15 | +); |
Property changes on: trunk/extensions/GeoData/GeoData.i18n.magic.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 16 | + native |
Index: trunk/extensions/GeoData/GeoData.i18n.php |
— | — | @@ -0,0 +1,28 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Internationalisation file for GeoData extension. |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
| 8 | + */ |
| 9 | + |
| 10 | +$messages = array(); |
| 11 | + |
| 12 | +$messages['en'] = array( |
| 13 | + 'geodata-desc' => 'Adds geographical coordinates storage and retrieval functionality.', |
| 14 | + 'geodata-bad-input' => 'Invalid arguments have been passed to the <nowiki>{{#coordinates:}}</nowiki> function', |
| 15 | + 'geodata-bad-latitude' => '<nowiki>{{#coordinates:}}</nowiki>: invalid latitude', |
| 16 | + 'geodata-bad-longitude' => '<nowiki>{{#coordinates:}}</nowiki>: invalid longitude', |
| 17 | + 'geodata-bad-region' => '<nowiki>{{#coordinates:}}</nowiki>: invalid region code format', |
| 18 | + 'geodata-multiple-primary' => '<nowiki>{{#coordinates:}}</nowiki>: cannot have more than one primary tag per page', |
| 19 | + 'geodata-limit-exceeded' => 'The limit of $1 <nowiki>{{#coordinates:}}</nowiki> tags per page has been exceeded', |
| 20 | + 'geodata-broken-tags-category' => 'Pages with malformed coordinate tags', |
| 21 | + 'geodata-primary-coordinate' => 'primary', |
| 22 | +); |
| 23 | + |
| 24 | +$messages['qqq'] = array( |
| 25 | + 'geodata-desc' => '{{desc}}', |
| 26 | + 'geodata-limit-exceeded' => '$1 is a number', |
| 27 | + 'geodata-broken-tags-category' => 'Name of the tracking category', |
| 28 | + 'geodata-primary-coordinate' => 'Localised name of parameter that makes <nowiki>{{#coordinates:}}</nowiki> tag primary', |
| 29 | +); |
\ No newline at end of file |
Property changes on: trunk/extensions/GeoData/GeoData.i18n.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 30 | + native |
Index: trunk/extensions/GeoData/GeoData.php |
— | — | @@ -22,13 +22,15 @@ |
23 | 23 | $wgAutoloadClasses['GeoMath'] = "$dir/GeoMath.php"; |
24 | 24 | $wgAutoloadClasses['CoordinatesOutput'] = "$dir/CoordinatesParserFunction.php"; |
25 | 25 | |
| 26 | +$wgExtensionMessagesFiles['GeoData'] = "$dir/GeoData.i18n.php"; |
| 27 | +$wgExtensionMessagesFiles['GeoDataMagic'] = "$dir/GeoData.i18n.magic.php"; |
| 28 | + |
26 | 29 | $wgAPIListModules['geosearch'] = 'ApiQueryGeoSearch'; |
27 | 30 | $wgAPIPropModules['coordinates'] = 'ApiQueryCoordinates'; |
28 | 31 | |
29 | 32 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'GeoDataHooks::onLoadExtensionSchemaUpdates'; |
30 | 33 | $wgHooks['ParserFirstCallInit'][] = 'GeoDataHooks::onParserFirstCallInit'; |
31 | 34 | $wgHooks['UnitTestsList'][] = 'GeoDataHooks::onUnitTestsList'; |
32 | | -$wgHooks['LanguageGetMagic'][] = 'GeoDataHooks::onLanguageGetMagic'; |
33 | 35 | $wgHooks['ArticleDeleteComplete'][] = 'GeoDataHooks::onArticleDeleteComplete'; |
34 | 36 | $wgHooks['LinksUpdate'][] = 'GeoDataHooks::onLinksUpdate'; |
35 | 37 | |
Index: trunk/extensions/GeoData/GeoDataHooks.php |
— | — | @@ -41,17 +41,6 @@ |
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | | - * LanguageGetMagic hook handler |
46 | | - * @see https://www.mediawiki.org/wiki/Manual:Hooks/LanguageGetMagic |
47 | | - * @param Array $magicWords |
48 | | - * @param String $langCode |
49 | | - */ |
50 | | - public static function onLanguageGetMagic( &$magicWords, $langCode ) { |
51 | | - $magicWords['coordinates'] = array( 0, 'coordinates' ); |
52 | | - return true; |
53 | | - } |
54 | | - |
55 | | - /** |
56 | 45 | * ArticleDeleteComplete hook handler |
57 | 46 | * @see https://www.mediawiki.org/wiki/Manual:Hooks/ArticleDeleteComplete |
58 | 47 | * |