http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73293

Revision: 73293
Author:   nikerabbit
Date:     2010-09-18 14:34:16 +0000 (Sat, 18 Sep 2010)

Log Message:
-----------
Use group labels instead of ids in graphs

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

Modified: trunk/extensions/Translate/SpecialTranslationStats.php
===================================================================
--- trunk/extensions/Translate/SpecialTranslationStats.php      2010-09-18 
14:30:53 UTC (rev 73292)
+++ trunk/extensions/Translate/SpecialTranslationStats.php      2010-09-18 
14:34:16 UTC (rev 73293)
@@ -434,6 +434,15 @@
                        $labels = array();
                }
 
+               foreach ( $labels as &$label ) {
+                       if ( strpos( $label, '@' ) === false ) continue;
+                       list( $groupId, $code ) = array_map( 'trim', explode( 
'@', $label, 2 ) );
+                       $code = TranslateUtils::getLanguageName( $code, false, 
$wgLang->getCode() ) . " ($code)";
+                       $group = MessageGroups::getGroup( $groupId 
)->getLabel();
+                       $label = "$group @ $code";
+               }
+
+
                $last = array_splice( $data, -1, 1 );
                $data[key( $last ) . '*'] = current( $last );
 
@@ -782,11 +791,6 @@
         * @return \string Label.
         */
        protected function makeLabel( $group, $code ) {
-               if ( $code ) {
-                       global $wgLang;
-                       $code = TranslateUtils::getLanguageName( $code, false, 
$wgLang->getCode() ) . " ($code)";
-               }
-
                if ( $group && $code ) {
                        return "$group @ $code";
                } elseif ( $group || $code ) {



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

Reply via email to