r93765 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93764‎ | r93765 | r93766 >
Date:16:26, 2 August 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Fix minor naming issue from r93314, add a bit to parameter documentation also
Modified paths:
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -266,7 +266,7 @@
267267 }
268268
269269 $params = $this->extractRequestParams();
270 - $langCode = isset( $params['languagecode'] ) ? $params['languagecode'] : '';
 270+ $langCode = isset( $params['inlanguagecode '] ) ? $params['inlanguagecode '] : '';
271271
272272 if( $langCode ) {
273273 $langNames = Language::getTranslatedLanguageNames( $langCode );
@@ -472,7 +472,7 @@
473473
474474 public function appendLanguages( $property ) {
475475 $params = $this->extractRequestParams();
476 - $langCode = isset( $params['languagecode'] ) ? $params['languagecode'] : '';
 476+ $langCode = isset( $params['inlanguagecode '] ) ? $params['inlanguagecode '] : '';
477477
478478 if( $langCode ) {
479479 $langNames = Language::getTranslatedLanguageNames( $langCode );
@@ -579,11 +579,12 @@
580580 ),
581581 'showalldb' => false,
582582 'numberingroup' => false,
583 - 'languagecode' => null,
 583+ 'inlanguagecode ' => null,
584584 );
585585 }
586586
587587 public function getParamDescription() {
 588+ $p = $this->getModulePrefix();
588589 return array(
589590 'prop' => array(
590591 'Which sysinfo properties to get:',
@@ -593,13 +594,13 @@
594595 ' specialpagealiases - List of special page aliases',
595596 ' magicwords - List of magic words and their aliases',
596597 ' statistics - Returns site statistics',
597 - ' interwikimap - Returns interwiki map (optionally filtered, (optionally localised))',
 598+ " interwikimap - Returns interwiki map (optionally filtered, (optionally localised by using {$p}inlanguagecode))",
598599 ' dbrepllag - Returns database server with the highest replication lag',
599600 ' usergroups - Returns user groups and the associated permissions',
600601 ' extensions - Returns extensions installed on the wiki',
601602 ' fileextensions - Returns list of file extensions allowed to be uploaded',
602603 ' rightsinfo - Returns wiki rights (license) information if available',
603 - ' languages - Returns a list of languages MediaWiki supports (optionally localised)',
 604+ " languages - Returns a list of languages MediaWiki supports (optionally localised by using {$p}inlanguagecode)",
604605 ' skins - Returns a list of all enabled skins',
605606 ' extensiontags - Returns a list of parser extension tags',
606607 ' functionhooks - Returns a list of parser function hooks',
@@ -608,7 +609,7 @@
609610 'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
610611 'showalldb' => 'List all database servers, not just the one lagging the most',
611612 'numberingroup' => 'Lists the number of users in user groups',
612 - 'languagecode' => 'Language code for localised language names (best effort, use CLDR extension)',
 613+ 'inlanguagecode ' => 'Language code for localised language names (best effort, use CLDR extension)',
613614 );
614615 }
615616

Follow-up revisions

RevisionCommit summaryAuthorDate
r103492Fix trailing space in r93765reedy19:00, 17 November 2011
r103494Fix the rest of 'inlanguage ' in r93765reedy19:06, 17 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93314siprop=interwikimap and siprop=languages can now use silanguagecode to have a...siebrand21:16, 27 July 2011

Comments

#Comment by Duplicatebug (talk | contribs)   18:51, 17 November 2011

This adds a (bad) space behind the param name, which make it hard to use.

#Comment by Reedy (talk | contribs)   19:00, 17 November 2011

Nice catch, fixed in followup. Thanks

#Comment by Duplicatebug (talk | contribs)   19:04, 17 November 2011

You have it wrong in the whole file:

$langCode = isset( $params['inlanguagecode '] ) ? $params['inlanguagecode '] : '';
$langCode = isset( $params['inlanguagecode '] ) ? $params['inlanguagecode '] : '';
'inlanguagecode ' => null,

Status & tagging log