https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113014

Revision: 113014
Author:   nikerabbit
Date:     2012-03-05 11:10:24 +0000 (Mon, 05 Mar 2012)
Log Message:
-----------
Message information was not shown for messages belonging to subsub^Ngroups

Modified Paths:
--------------
    trunk/extensions/Translate/Groups.php

Modified: trunk/extensions/Translate/Groups.php
===================================================================
--- trunk/extensions/Translate/Groups.php       2012-03-05 10:39:30 UTC (rev 
113013)
+++ trunk/extensions/Translate/Groups.php       2012-03-05 11:10:24 UTC (rev 
113014)
@@ -668,11 +668,17 @@
        }
 
        public function getMessage( $key, $code ) {
-               $id = TranslateUtils::messageKeyToGroup( $this->getNamespace(), 
$key );
-               $groups = $this->getGroups();
-
-               if ( isset( $groups[$id] ) ) {
-                       return $groups[$id]->getMessage( $key, $code );
+               /* Just hand over the message content retrieval to the primary 
message
+                * group directly. This used to iterate over the subgroups 
looking for
+                * the primary group, but that might actually be under some 
other
+                * aggregate message group.
+                * @TODO: implement getMessageContent to avoid hardcoding the 
namespace
+                * here.
+                */
+               $groupId = TranslateUtils::messageKeyToGroup( 
$this->getNamespace(), $key );
+               $group = MessageGroups::getGroup( $groupId );
+               if ( $group ) {
+                       return $group->getMessage( $key, $code );
                } else {
                        return null;
                }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to