Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ciencia/d4d3b50c8e7f9c0baff11ec2a4d80e8f to your computer and use it in GitHub Desktop.
Save ciencia/d4d3b50c8e7f9c0baff11ec2a4d80e8f to your computer and use it in GitHub Desktop.
patch MediaWiki core enable Special:Statistics description
From c695c9e6374e64321d96d150e6ab8a93a55b1360 Mon Sep 17 00:00:00 2001
From: Ammar Abdulhamid
Date: Wed, 15 Jul 2020 20:56:45 +0100
Subject: [PATCH] Allow description text for uploaded files line in Special:Statistics
Also make Statistics summary text to really work. The message
exists for a long time but it is not being used in the special page.
Bug: T258095
Change-Id: Ic228fdb7b13ef824ef0611d9cb2d5b79504cd929
---
diff --git a/includes/specials/SpecialStatistics.php b/includes/specials/SpecialStatistics.php
index 3f3ab67..cbe2893 100644
--- a/includes/specials/SpecialStatistics.php
+++ b/includes/specials/SpecialStatistics.php
@@ -39,6 +39,7 @@
public function execute( $par ) {
$this->setHeaders();
+ $this->outputHeader();
$this->getOutput()->addModuleStyles( 'mediawiki.special' );
$this->edits = SiteStats::edits();
@@ -144,7 +145,7 @@
$linkRenderer->makeKnownLink( SpecialPage::getTitleFor( 'MediaStatistics' ),
$this->msg( 'statistics-files' )->text() ),
$this->getLanguage()->formatNum( $this->images ),
- [ 'class' => 'mw-statistics-files' ] );
+ [ 'class' => 'mw-statistics-files' ], 'statistics-files-desc' );
}
return $pageStatsHtml;
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index a3a020d..85340ff 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -2025,6 +2025,7 @@
"statistics-pages": "Pages",
"statistics-pages-desc": "All pages in the wiki, including talk pages, redirects, etc.",
"statistics-files": "Uploaded files",
+ "statistics-files-desc": "",
"statistics-edits": "Page edits since {{SITENAME}} was set up",
"statistics-edits-average": "Average edits per page",
"statistics-users": "Registered users",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 8f32a4d..b959030 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -2241,6 +2241,7 @@
"statistics-pages": "Used in [[Special:Statistics]]\n{{Identical|Page}}",
"statistics-pages-desc": "Tooltip shown over ''Pages'' (or as a note below it) in [[Special:Statistics]]",
"statistics-files": "Used in [[Special:Statistics]].\n{{Identical|Uploaded file}}",
+ "statistics-files-desc": "Tooltip shown over ''Uploaded file'' (or as a note below it) in [[Special:Statistics]]",
"statistics-edits": "Used in [[Special:Statistics]]",
"statistics-edits-average": "Used in [[Special:Statistics]]",
"statistics-users": "Used in [[Special:Statistics]].",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment