r113014 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113013‎ | r113014 | r113015 >
Date:11:10, 5 March 2012
Author:nikerabbit
Status:ok
Tags:i18nreview 
Comment:
Message information was not shown for messages belonging to subsub^Ngroups
Modified paths:
  • /trunk/extensions/Translate/Groups.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Groups.php
@@ -668,11 +668,17 @@
669669 }
670670
671671 public function getMessage( $key, $code ) {
672 - $id = TranslateUtils::messageKeyToGroup( $this->getNamespace(), $key );
673 - $groups = $this->getGroups();
674 -
675 - if ( isset( $groups[$id] ) ) {
676 - return $groups[$id]->getMessage( $key, $code );
 672+ /* Just hand over the message content retrieval to the primary message
 673+ * group directly. This used to iterate over the subgroups looking for
 674+ * the primary group, but that might actually be under some other
 675+ * aggregate message group.
 676+ * @TODO: implement getMessageContent to avoid hardcoding the namespace
 677+ * here.
 678+ */
 679+ $groupId = TranslateUtils::messageKeyToGroup( $this->getNamespace(), $key );
 680+ $group = MessageGroups::getGroup( $groupId );
 681+ if ( $group ) {
 682+ return $group->getMessage( $key, $code );
677683 } else {
678684 return null;
679685 }

Status & tagging log