From 72bec61d7ca4bc24731389f30c790662458c12c7 Mon Sep 17 00:00:00 2001 From: Jack Phoenix Date: Sun, 15 Sep 2019 23:34:27 +0300 Subject: [PATCH] Added option to specify "Various authors" as author in extension credits using "..." as the _only_ author name If the "author" array contains more than one entry and "..." is one of the entries in the array, "..." will be parsed as "others" (version-poweredby-others i18n message) like previously. Change-Id: Ibebd3c38a674abd9f066b38e92c7f712f7b3ba8d --- RELEASE-NOTES-1.34 | 4 ++++ includes/specials/SpecialVersion.php | 22 +++++++++++++++++++++- languages/i18n/en.json | 1 + languages/i18n/qqq.json | 1 + 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index a99fd31990..2e075ec20a 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -572,6 +572,10 @@ because of Phabricator reports. respectively instead. === Other changes in 1.34 === +* Added option to specify "Various authors" as author in extension credits using + "..." as the only author name. If the "author" array contains more than one + entry and "..." is one of the entries in the array, "..." will be parsed as + "others" (version-poweredby-others i18n message) like previously. * … == Compatibility == diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index fa78cbe7ba..6ad02f0026 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -988,7 +988,27 @@ class SpecialVersion extends SpecialPage { $linkRenderer = $this->getLinkRenderer(); $list = []; - foreach ( (array)$authors as $item ) { + $authors = (array)$authors; + + // Special case: if the authors array has only one item and it is "...", + // it should not be rendered as the "version-poweredby-others" i18n msg, + // but rather as "version-poweredby-various" i18n msg instead. + if ( count( $authors ) === 1 && $authors[0] === '...' ) { + // Link to the extension's or skin's AUTHORS or CREDITS file, if there is + // such a file; otherwise just return the i18n msg as-is + if ( $extName && $this->getExtAuthorsFileName( $extDir ) ) { + return $linkRenderer->makeLink( + $this->getPageTitle( "Credits/$extName" ), + $this->msg( 'version-poweredby-various' )->text() + ); + } else { + return $this->msg( 'version-poweredby-various' )->escaped(); + } + } + + // Otherwise, if we have an actual array that has more than one item, + // process each array item as usual + foreach ( $authors as $item ) { if ( $item == '...' ) { $hasOthers = true; diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 82826c513f..d34a3e8fac 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -3580,6 +3580,7 @@ "version-poweredby-credits": "This wiki is powered by [https://www.mediawiki.org/ MediaWiki], copyright © 2001-$1 $2.", "version-poweredby-others": "others", "version-poweredby-translators": "translatewiki.net translators", + "version-poweredby-various": "Various authors", "version-credits-summary": "We would like to recognize the following persons for their contribution to [[Special:Version|MediaWiki]].", "version-license-info": "MediaWiki is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nMediaWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received [{{SERVER}}{{SCRIPTPATH}}/COPYING a copy of the GNU General Public License] along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA or [//www.gnu.org/licenses/old-licenses/gpl-2.0.html read it online].", "version-software": "Installed software", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index a33608f5fb..c0d4d81da9 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -3790,6 +3790,7 @@ "version-poweredby-credits": "Message shown on [[Special:Version]]. Parameters:\n* $1 - the current year\n* $2 - a list of selected MediaWiki authors", "version-poweredby-others": "Used at the end of {{msg-mw|version-poweredby-credits}} on [[Special:Version]]. First, there's a long list of selected MediaWiki authors, then a comma and then this translation, which is supposed to credit the many other people than developer helping with MediaWiki.\n{{Identical|Other}}", "version-poweredby-translators": "Used as label for a link to [[Translating:MediaWiki/Credits]].\n\nPreceded by {{msg-mw|version-poweredby-others}} and {{msg-mw|and}}.\n\nUsed at the end of {{msg-mw|version-poweredby-credits}} on [[Special:Version]].", + "version-poweredby-various": "Shown on [[Special:Version]] as an author name if the extension or skin (etc.) credits contain only ... which is used to indicate various (unknown or unspecified) authors. See also {{msg-mw|version-poweredby-others}}, which is used when an extension or a skin contains code by various named and unnamed contributors.", "version-credits-summary": "Summary of the [[Special:Version/Credits]] sub page, which lists all developers etc. who contributed to MediaWiki. Shown at the top.", "version-license-info": "[[wikipedia:GNU GPL|GNU GPL]] notice shown at [[Special:Version]]. See //www.gnu.org/licenses/old-licenses/gpl-2.0-translations.html for available translations.", "version-software": "Message shown on [[Special:Version]].\nThis message is followed by the list of installed software (MediaWiki, PHP and MySQL).", -- 2.20.1