Merge "Add PLURAL support for 'revertpage' messages"

This commit is contained in:
jenkins-bot 2023-05-19 10:21:40 +00:00 committed by Gerrit Code Review
commit 4329825627
3 changed files with 14 additions and 6 deletions

View file

@ -512,6 +512,13 @@ class RollbackPage {
* @return string
*/
private function getSummary( RevisionRecord $current, RevisionRecord $target ): string {
$revisionsBetween = $this->revisionStore->countRevisionsBetween(
$current->getPageId(),
$target,
$current,
1000,
RevisionStore::INCLUDE_NEW
);
$currentEditorForPublic = $current->getUser( RevisionRecord::FOR_PUBLIC );
if ( $this->summary === '' ) {
if ( !$currentEditorForPublic ) { // no public user name
@ -535,6 +542,7 @@ class RollbackPage {
Message::dateTimeParam( $target->getTimestamp() ),
$current->getId(),
Message::dateTimeParam( $current->getTimestamp() ),
$revisionsBetween,
];
if ( $summary instanceof MessageValue ) {
$summary = ( new Converter() )->convertMessageValue( $summary );

View file

@ -2553,9 +2553,9 @@
"cantrollback": "Cannot revert the edit.\nThe last contributor is the only author of this page.",
"alreadyrolled": "Cannot rollback the last edit of [[:$1]] by [[User:$2|$2]] ([[User talk:$2|talk]]{{int:pipe-separator}}[[Special:Contributions/$2|{{int:contribslink}}]]).\nSomeone else has edited or rolled back the page already.\n\nThe last edit to the page was by [[User:$3|$3]] ([[User talk:$3|talk]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]).",
"editcomment": "The edit summary was: <em>$1</em>.",
"revertpage": "Reverted edits by [[Special:Contributions/$2|$2]] ([[User talk:$2|talk]]) to last revision by [[User:$1|$1]]",
"revertpage-anon": "Reverted edits by [[Special:Contributions/$2|$2]] to last revision by [[User:$1|$1]]",
"revertpage-nouser": "Reverted edits by a hidden user to last revision by {{GENDER:$1|[[User:$1|$1]]}}",
"revertpage": "Reverted {{PLURAL:$7|edit|edits}} by [[Special:Contributions/$2|$2]] ([[User talk:$2|talk]]) to last revision by [[User:$1|$1]]",
"revertpage-anon": "Reverted {{PLURAL:$7|edit|edits}} by [[Special:Contributions/$2|$2]] to last revision by [[User:$1|$1]]",
"revertpage-nouser": "Reverted {{PLURAL:$7|edit|edits}} by a hidden user to last revision by {{GENDER:$1|[[User:$1|$1]]}}",
"rollback-success": "Reverted edits by {{GENDER:$3|$1}};\nchanged back to last revision by {{GENDER:$4|$2}}.",
"sessionfailure-title": "Session failure",
"sessionfailure": "There seems to be a problem with your login session;\nthis action has been canceled as a precaution against session hijacking.\nPlease resubmit the form.",

View file

@ -2804,9 +2804,9 @@
"cantrollback": "Used as error message when rollback fails due to there not being a valid revision to revert back to.\n\nSee also:\n* {{msg-mw|Notvisiblerev}}\n{{Identical|Revert}}\n{{Identical|Rollback}}",
"alreadyrolled": "Appear when there's rollback and/or edit collision.\n\nRefers to:\n* {{msg-mw|Pipe-separator}}\n* {{msg-mw|Contribslink}}\nParameters:\n* $1 - the page to be rolled back\n* $2 - the editor to be rolled-back of that page\n* $3 - the editor that cause collision\n{{Identical|Rollback}}",
"editcomment": "Only shown if there is an edit {{msg-mw|Summary}}. Parameters:\n* $1 - the edit summary",
"revertpage": "Parameters:\n* $1 - username of the author of the reverted edits\n* $2 - username of the author of the restored version\n{{Identical|Revert}}",
"revertpage-anon": "Parameters:\n* $1 - username 1\n* $2 - username 2\n* $3 - (Optional) revision ID of the revision reverted to\n* $4 - (Optional) timestamp of the revision reverted to\n* $5 - (Optional) revision ID of the revision reverted from\n* $6 - (Optional) timestamp of the revision reverted from\nSee also:\n* {{msg-mw|Revertpage}}\n* {{msg-mw|Revertpage-nouser}}\n{{Identical|Revert}}",
"revertpage-nouser": "This is a confirmation message a user sees after reverting, when the username of the version is hidden with RevisionDelete.\n\nIn other cases the message {{msg-mw|Revertpage}} or {{msg-mw|Revertpage-anon}} is used.\n\nParameters:\n* $1 - username 1, can be used for GENDER\n* $2 - (Optional) username 2\n* $3 - (Optional) revision ID of the revision reverted to\n* $4 - (Optional) timestamp of the revision reverted to\n* $5 - (Optional) revision ID of the revision reverted from\n* $6 - (Optional) timestamp of the revision reverted from",
"revertpage": "Parameters:\n* $1 - username of the author of the reverted edits\n* $2 - username of the author of the restored version\n* $3 - (Optional) revision ID of the revision reverted to\n* $4 - (Optional) timestamp of the revision reverted to\n* $5 - (Optional) revision ID of the revision reverted from\n* $6 - (Optional) timestamp of the revision reverted from\n* $7 - the number of edits that have been reverted\n{{Identical|Revert}}",
"revertpage-anon": "Parameters:\n* $1 - username 1\n* $2 - username 2\n* $3 - (Optional) revision ID of the revision reverted to\n* $4 - (Optional) timestamp of the revision reverted to\n* $5 - (Optional) revision ID of the revision reverted from\n* $6 - (Optional) timestamp of the revision reverted from\n* $7 - the number of edits that have been reverted\nSee also:\n* {{msg-mw|Revertpage}}\n* {{msg-mw|Revertpage-nouser}}\n{{Identical|Revert}}",
"revertpage-nouser": "This is a confirmation message a user sees after reverting, when the username of the version is hidden with RevisionDelete.\n\nIn other cases the message {{msg-mw|Revertpage}} or {{msg-mw|Revertpage-anon}} is used.\n\nParameters:\n* $1 - username 1, can be used for GENDER\n* $2 - (Optional) username 2\n* $3 - (Optional) revision ID of the revision reverted to\n* $4 - (Optional) timestamp of the revision reverted to\n* $5 - (Optional) revision ID of the revision reverted from\n* $6 - (Optional) timestamp of the revision reverted from\n* $7 - the number of edits that have been reverted",
"rollback-success": "This message shows up on screen after successful revert (generally visible only to admins). Parameters:\n* $1 - user whose changes have been reverted\n* $2 - user who produced version, which replaces reverted version\n* $3 - the first user's name, can be used for GENDER\n* $4 - the second user's name, can be used for GENDER\n{{Identical|Revert}}\n{{Identical|Rollback}}",
"sessionfailure-title": "Used as title of the error message {{msg-mw|Sessionfailure}}.",
"sessionfailure": "Used as error message.\n\nThe title for this error message is {{msg-mw|Sessionfailure-title}}.",