Index: trunk/extensions/Translate/Groups.php |
— | — | @@ -668,11 +668,17 @@ |
669 | 669 | } |
670 | 670 | |
671 | 671 | 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 ); |
677 | 683 | } else { |
678 | 684 | return null; |
679 | 685 | } |