Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php |
— | — | @@ -209,7 +209,13 @@ |
210 | 210 | } |
211 | 211 | |
212 | 212 | public function load( $code ) { |
213 | | - return array(); // no-op |
| 213 | + $this->init(); |
| 214 | + $array = array(); |
| 215 | + foreach ( $this->classes as $class ) { |
| 216 | + // Use wfArrayMerge because of string keys |
| 217 | + $array = wfArrayMerge( $array, $class->load( $code ) ); |
| 218 | + } |
| 219 | + return $array; |
214 | 220 | } |
215 | 221 | |
216 | 222 | public function getMessage( $key, $code ) { |
Index: trunk/extensions/Translate/MessageCollection.php |
— | — | @@ -269,6 +269,8 @@ |
270 | 270 | |
271 | 271 | protected function loadInfo( array $keys ) { |
272 | 272 | if ( $this->dbInfo !== null ) return; |
| 273 | + |
| 274 | + $this->dbInfo = array(); // Something iterable |
273 | 275 | if ( !count($keys) ) return; |
274 | 276 | |
275 | 277 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -295,6 +297,8 @@ |
296 | 298 | |
297 | 299 | protected function loadData( $keys ) { |
298 | 300 | if ( $this->dbData !== null ) return; |
| 301 | + |
| 302 | + $this->dbData = array(); // Something iterable |
299 | 303 | if ( !count($keys) ) return; |
300 | 304 | |
301 | 305 | $dbr = wfGetDB( DB_SLAVE ); |
Index: trunk/extensions/Translate/SpecialLanguageStats.php |
— | — | @@ -207,6 +207,7 @@ |
208 | 208 | |
209 | 209 | // Initialise messages |
210 | 210 | $collection = $g->initCollection( $code ); |
| 211 | + $collection->setInFile( $g->load( $code ) ); |
211 | 212 | $collection->filter( 'ignored' ); |
212 | 213 | $collection->filter( 'optional' ); |
213 | 214 | // Store the count of real messages for later calculation. |
— | — | @@ -234,9 +235,18 @@ |
235 | 236 | continue; |
236 | 237 | } |
237 | 238 | |
238 | | - $translatedPercentage = wfMsg( 'percent', $wgLang->formatNum( round( 100 * $translated / $total, 2 ) ) ); |
239 | | - $fuzzyPercentage = wfMsg( 'percent', $wgLang->formatNum( round( 100 * $fuzzy / $total, 2 ) ) ); |
| 239 | + $translatedPercentage = $wgLang->formatNum( round( 100 * $translated / $total, 2 ) ); |
| 240 | + $fuzzyPercentage = $wgLang->formatNum( round( 100 * $fuzzy / $total, 2 ) ); |
240 | 241 | |
| 242 | + if ( !wfEmptyMsg( 'percent', wfMsgNoTrans('percent')) ) { |
| 243 | + $translatedPercentage = wfMsg( 'percent', $translatedPercentage ); |
| 244 | + $fuzzyPercentage = wfMsg( 'percent', $fuzzyPercentage ); |
| 245 | + } else { |
| 246 | + // For 1.14 compatability |
| 247 | + $translatedPercentage = "$translatedPercentage%"; |
| 248 | + $fuzzyPercentage = "$fuzzyPercentage%"; |
| 249 | + } |
| 250 | + |
241 | 251 | $translateTitle = SpecialPage::getTitleFor( 'Translate' ); |
242 | 252 | $queryParameters = array( |
243 | 253 | 'group' => $g->getId(), |