r110360 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110359‎ | r110360 | r110361 >
Date:07:18, 31 January 2012
Author:nikerabbit
Status:ok
Tags:i18nreview 
Comment:
Fix double counting of statusnet plugin messages as untranslated for whole of statusnet
Modified paths:
  • /trunk/extensions/Translate/Groups.php (modified) (history)
  • /trunk/translatewiki/StatusNet/StatusNet.yaml (modified) (history)

Diff [purge]

Index: trunk/translatewiki/StatusNet/StatusNet.yaml
@@ -33,7 +33,7 @@
3434
3535 GROUPS:
3636 - out-statusnet-core
37 - - out-statusnet-plugin-*
 37+ - out-statusnet-plugin-0-all
3838 ---
3939 BASIC:
4040 id: out-statusnet-plugin-0-all
Index: trunk/extensions/Translate/Groups.php
@@ -660,15 +660,19 @@
661661 return $all;
662662 }
663663
664 - public function initCollection( $code ) {
 664+ protected function loadMessagesFromCache( $groups ) {
665665 $messages = array();
666 -
667 - foreach ( $this->getGroups() as $group ) {
 666+ foreach ( $groups as $group ) {
668667 if ( $group instanceof MessageGroupOld ) {
669668 $messages += $group->getDefinitions();
670669 continue;
671670 }
672671
 672+ if ( $group instanceof AggregateMessageGroup ) {
 673+ $messages += $this->loadMessagesFromCache( $group->getGroups() );
 674+ continue;
 675+ }
 676+
673677 $cache = new MessageGroupCache( $group );
674678 if ( $cache->exists() ) {
675679 foreach ( $cache->getKeys() as $key ) {
@@ -676,7 +680,12 @@
677681 }
678682 }
679683 }
 684+ return $messages;
 685+ }
 686+
680687
 688+ public function initCollection( $code ) {
 689+ $messages = $this->loadMessagesFromCache( $this->getGroups() );
681690 $namespace = $this->getNamespace();
682691 $definitions = new MessageDefinitions( $messages, $namespace );
683692 $collection = MessageCollection::newFromDefinitions( $definitions, $code );

Status & tagging log