http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73314
Revision: 73314
Author: nikerabbit
Date: 2010-09-19 11:57:48 +0000 (Sun, 19 Sep 2010)
Log Message:
-----------
Also show labels instead of group ids if there is no filtering per language
Modified Paths:
--------------
trunk/extensions/Translate/SpecialTranslationStats.php
Modified: trunk/extensions/Translate/SpecialTranslationStats.php
===================================================================
--- trunk/extensions/Translate/SpecialTranslationStats.php 2010-09-19
11:51:12 UTC (rev 73313)
+++ trunk/extensions/Translate/SpecialTranslationStats.php 2010-09-19
11:57:48 UTC (rev 73314)
@@ -436,10 +436,16 @@
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";
+ list( $groupId, $code ) = explode( '@', $label, 2 );
+ if ( $code && $groupId ) {
+ $code = TranslateUtils::getLanguageName( $code,
false, $wgLang->getCode() ) . " ($code)";
+ $group = MessageGroups::getGroup( $groupId
)->getLabel();
+ $label = "$group @ $code";
+ } elseif( $code ) {
+ $label = TranslateUtils::getLanguageName(
$code, false, $wgLang->getCode() ) . " ($code)";
+ } elseif( $groupId ) {
+ $label = MessageGroups::getGroup( $groupId
)->getLabel();
+ }
}
@@ -791,10 +797,8 @@
* @return \string Label.
*/
protected function makeLabel( $group, $code ) {
- if ( $group && $code ) {
- return "$group @ $code";
- } elseif ( $group || $code ) {
- return "$group$code";
+ if ( $group || $code ) {
+ return "$gr...@$code";
} else {
return 'all';
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs