r73293 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73292‎ | r73293 | r73294 >
Date:14:34, 18 September 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Use group labels instead of ids in graphs
Modified paths:
  • /trunk/extensions/Translate/SpecialTranslationStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/SpecialTranslationStats.php
@@ -434,6 +434,15 @@
435435 $labels = array();
436436 }
437437
 438+ foreach ( $labels as &$label ) {
 439+ if ( strpos( $label, '@' ) === false ) continue;
 440+ list( $groupId, $code ) = array_map( 'trim', explode( '@', $label, 2 ) );
 441+ $code = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() ) . " ($code)";
 442+ $group = MessageGroups::getGroup( $groupId )->getLabel();
 443+ $label = "$group @ $code";
 444+ }
 445+
 446+
438447 $last = array_splice( $data, -1, 1 );
439448 $data[key( $last ) . '*'] = current( $last );
440449
@@ -782,11 +791,6 @@
783792 * @return \string Label.
784793 */
785794 protected function makeLabel( $group, $code ) {
786 - if ( $code ) {
787 - global $wgLang;
788 - $code = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() ) . " ($code)";
789 - }
790 -
791795 if ( $group && $code ) {
792796 return "$group @ $code";
793797 } elseif ( $group || $code ) {

Status & tagging log