Index: trunk/extensions/Translate/utils/MessageGroupStats.php |
— | — | @@ -231,10 +231,18 @@ |
232 | 232 | |
233 | 233 | $aggregates = array( 0, 0, 0 ); |
234 | 234 | foreach ( $group->getGroups() as $sid => $sgroup ) { |
| 235 | + # Discouraged groups may belong to a another group, usually if there |
| 236 | + # is a aggregate group for all translatable pages. In that case |
| 237 | + # calculate and store the statistics, but don't count them as part of |
| 238 | + # the aggregate group, so that the numbers in Special:LanguageStats |
| 239 | + # add up. The statistics for discouraged groups can still be viewed |
| 240 | + # through Special:MessageGroupStats. |
235 | 241 | if ( !isset( $stats[$sid][$code] ) ) { |
236 | 242 | $stats[$sid][$code] = self::forItemInternal( $stats, $sgroup, $code ); |
237 | 243 | } |
238 | | - $aggregates = self::multiAdd( $aggregates, $stats[$sid][$code] ); |
| 244 | + if ( MessageGroups::getPriority( $sgroup ) !== 'discouraged' ) { |
| 245 | + $aggregates = self::multiAdd( $aggregates, $stats[$sid][$code] ); |
| 246 | + } |
239 | 247 | } |
240 | 248 | $stats[$id][$code] = $aggregates; |
241 | 249 | } else { |
Index: trunk/extensions/Translate/specials/SpecialLanguageStats.php |
— | — | @@ -299,6 +299,12 @@ |
300 | 300 | return ''; |
301 | 301 | } |
302 | 302 | |
| 303 | + # These are hidden, and the code in MessageGroupStats makes sure that |
| 304 | + # these are not counted in the aggregate groups they may belong. |
| 305 | + if ( MessageGroups::getPriority( $group ) === 'discouraged' ) { |
| 306 | + return ''; |
| 307 | + } |
| 308 | + |
303 | 309 | $stats = $cache[$group->getId()]; |
304 | 310 | |
305 | 311 | list( $total, $translated, $fuzzy ) = $stats; |