Improve help text for list=alllinks and alltransclusions
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 21 Jun 2013 21:17:07 +0000 (23:17 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Fri, 21 Jun 2013 21:17:07 +0000 (23:17 +0200)
This patch set changed some
- "link titles" to "linked titles"
- "transclusion titles" to "transcluded titles"

Change-Id: If536368e95ca5e160d8a69e832e67e3248b787fd

includes/api/ApiQueryAllLinks.php

index e355f8b..3744e3c 100644 (file)
@@ -40,8 +40,8 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
                                $this->dfltNamespace = NS_MAIN;
                                $this->indexTag = 'l';
                                $this->description = 'Enumerate all links that point to a given namespace';
-                               $this->descriptionLink = 'link';
-                               $this->descriptionLinked = 'linked';
+                               $this->descriptionWhat = 'link';
+                               $this->descriptionTargets = 'linked titles';
                                $this->descriptionLinking = 'linking';
                                break;
                        case 'alltransclusions':
@@ -51,8 +51,8 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
                                $this->dfltNamespace = NS_TEMPLATE;
                                $this->indexTag = 't';
                                $this->description = 'List all transclusions (pages embedded using {{x}}), including non-existing';
-                               $this->descriptionLink = 'transclusion';
-                               $this->descriptionLinked = 'transcluded';
+                               $this->descriptionWhat = 'transclusion';
+                               $this->descriptionTargets = 'transcluded titles';
                                $this->descriptionLinking = 'transcluding';
                                break;
                        default:
@@ -90,7 +90,7 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
                if ( $params['unique'] ) {
                        if ( $fld_ids ) {
                                $this->dieUsage(
-                                       "{$this->getModuleName()} cannot return corresponding page ids in unique {$this->descriptionLink}s mode",
+                                       "{$this->getModuleName()} cannot return corresponding page ids in unique {$this->descriptionWhat}s mode",
                                        'params' );
                        }
                        $this->addOption( 'DISTINCT' );
@@ -232,23 +232,24 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
 
        public function getParamDescription() {
                $p = $this->getModulePrefix();
-               $link = $this->descriptionLink;
+               $what = $this->descriptionWhat;
+               $targets = $this->descriptionTargets;
                $linking = $this->descriptionLinking;
                return array(
-                       'from' => "The title of the $link to start enumerating from",
-                       'to' => "The title of the $link to stop enumerating at",
-                       'prefix' => "Search for all $link titles that begin with this value",
+                       'from' => "The title of the $what to start enumerating from",
+                       'to' => "The title of the $what to stop enumerating at",
+                       'prefix' => "Search for all $targets that begin with this value",
                        'unique' => array(
-                                       "Only show distinct $link titles. Cannot be used with {$p}prop=ids.",
-                                       'When used as a generator, yields target pages instead of source pages.',
+                               "Only show distinct $targets. Cannot be used with {$p}prop=ids.",
+                               'When used as a generator, yields target pages instead of source pages.',
                        ),
                        'prop' => array(
                                'What pieces of information to include',
                                " ids    - Adds the pageid of the $linking page (Cannot be used with {$p}unique)",
-                               " title  - Adds the title of the $link",
+                               " title  - Adds the title of the $what",
                        ),
                        'namespace' => 'The namespace to enumerate',
-                       'limit' => "How many total items to return",
+                       'limit' => 'How many total items to return',
                        'continue' => 'When more results are available, use this to continue',
                        'dir' => 'The direction in which to list',
                );
@@ -272,29 +273,31 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
 
        public function getPossibleErrors() {
                $m = $this->getModuleName();
-               $link = $this->descriptionLink;
+               $what = $this->descriptionWhat;
                return array_merge( parent::getPossibleErrors(), array(
-                       array( 'code' => 'params', 'info' => "{$m} cannot return corresponding page ids in unique {$link}s mode" ),
+                       array( 'code' => 'params', 'info' => "{$m} cannot return corresponding page ids in unique {$what}s mode" ),
                ) );
        }
 
        public function getExamples() {
                $p = $this->getModulePrefix();
-               $link = $this->descriptionLink;
-               $linked = $this->descriptionLinked;
+               $name = $this->getModuleName();
+               $what = $this->descriptionWhat;
+               $targets = $this->descriptionTargets;
                return array(
-                       "api.php?action=query&list=all{$link}s&{$p}from=B&{$p}prop=ids|title"
-                                       => "List $linked titles with page ids they are from, including missing ones. Start at B",
-                       "api.php?action=query&list=all{$link}s&{$p}unique=&{$p}from=B"
-                                       => "List unique $linked titles",
-                       "api.php?action=query&generator=all{$link}s&g{$p}unique=&g{$p}from=B"
-                                       => "Gets all $link targets, marking the missing ones",
-                       "api.php?action=query&generator=all{$link}s&g{$p}from=B"
-                                       => "Gets pages containing the {$link}s",
+                       "api.php?action=query&list={$name}&{$p}from=B&{$p}prop=ids|title"
+                                       => "List $targets with page ids they are from, including missing ones. Start at B",
+                       "api.php?action=query&list={$name}&{$p}unique=&{$p}from=B"
+                                       => "List unique $targets",
+                       "api.php?action=query&generator={$name}&g{$p}unique=&g{$p}from=B"
+                                       => "Gets all $targets, marking the missing ones",
+                       "api.php?action=query&generator={$name}&g{$p}from=B"
+                                       => "Gets pages containing the {$what}s",
                );
        }
 
        public function getHelpUrls() {
-               return "https://www.mediawiki.org/wiki/API:All{$this->descriptionLink}s";
+               $name = ucfirst( $this->getModuleName() );
+               return "https://www.mediawiki.org/wiki/API:{$name}";
        }
 }