Added option to specify "Various authors" as author in extension credits using "...
authorJack Phoenix <ashley@uncyclomedia.co>
Sun, 15 Sep 2019 20:34:27 +0000 (23:34 +0300)
committerJack Phoenix <ashley@uncyclomedia.co>
Sun, 29 Sep 2019 08:35:32 +0000 (11:35 +0300)
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
includes/specials/SpecialVersion.php
languages/i18n/en.json
languages/i18n/qqq.json

index a99fd31..2e075ec 100644 (file)
@@ -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 ==
index fa78cbe..6ad02f0 100644 (file)
@@ -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;
 
index 82826c5..d34a3e8 100644 (file)
        "version-poweredby-credits": "This wiki is powered by <strong>[https://www.mediawiki.org/ MediaWiki]</strong>, 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 <em>WITHOUT ANY WARRANTY</em>; without even the implied warranty of <strong>MERCHANTABILITY</strong> or <strong>FITNESS FOR A PARTICULAR PURPOSE</strong>. 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",
index a33608f..c0d4d81 100644 (file)
        "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 <code>...</code> 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).",