r89465 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89464‎ | r89465 | r89466 >
Date:14:18, 4 June 2011
Author:nikerabbit
Status:deferred
Tags:
Comment:
Add count to special:supportedlanguages
Modified paths:
  • /trunk/extensions/Translate/Translate.i18n.php (modified) (history)
  • /trunk/extensions/Translate/specials/SpecialSupportedLanguages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Translate.i18n.php
@@ -261,6 +261,7 @@
262262 On this page a list of language portals will appear for all portals corresponding with a defined language code and a subpage called "translators".
263263 The subpage "translators" must contain the template [[:{{ns:template}}:User|User]], taking a user name as parameter.',
264264 'supportedlanguages-recenttranslations' => 'recent translations',
 265+ 'supportedlanguages-count' => '$1 {{plural:$1|language|languages}} in total.',
265266
266267 'translate-save' => 'Save ($1)',
267268
Index: trunk/extensions/Translate/specials/SpecialSupportedLanguages.php
@@ -83,7 +83,9 @@
8484 $user = Title::capitalize( $match[1], NS_USER );
8585 $lb->add( NS_USER, $user );
8686 $lb->add( NS_USER_TALK, $user );
87 - @$users[$code][] = $user;
 87+
 88+ if ( !isset( $users[$code] ) ) $users[$code] = array();
 89+ $users[$code][] = $user;
8890 }
8991 }
9092
@@ -94,9 +96,7 @@
9597 $skin = $wgUser->getSkin();
9698 $portalBaseText = wfMsg( 'portal' );
9799
98 - /**
99 - * Information to be used inside the foreach loop.
100 - */
 100+ // Information to be used inside the foreach loop.
101101 $linkInfo['rc']['title'] = SpecialPage::getTitleFor( 'Recentchanges' );
102102 $linkInfo['rc']['msg'] = wfMsg( 'supportedlanguages-recenttranslations' );
103103 $linkInfo['stats']['title'] = SpecialPage::getTitleFor( 'LanguageStats' );
@@ -173,5 +173,7 @@
174174 count( $users[$code] )
175175 ) . "</p>\n" );
176176 }
 177+ $wgOut->addHtml( Html::element( 'hr' ) );
 178+ $wgOut->addWikiMsg( 'supportedlanguages-count', $wgLang->formatNum( count( $users ) ) );
177179 }
178180 }

Status & tagging log