MegaAlex has uploaded a new change for review. https://gerrit.wikimedia.org/r/103119
Change subject: i18n: Add PLURAL/GENDER support to revreview-reject-summary-* ...................................................................... i18n: Add PLURAL/GENDER support to revreview-reject-summary-* Spotted by Purodha Change-Id: I0029ffa898120e529d095f8c1651dbcd1b3c9889 --- M frontend/RejectConfirmationFormUI.php M frontend/language/RevisionReview.i18n.php 2 files changed, 33 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs refs/changes/19/103119/1 diff --git a/frontend/RejectConfirmationFormUI.php b/frontend/RejectConfirmationFormUI.php index 3e94566..d91e77d 100644 --- a/frontend/RejectConfirmationFormUI.php +++ b/frontend/RejectConfirmationFormUI.php @@ -62,6 +62,8 @@ $rejectAuthors[] = $rev->isDeleted( Revision::DELETED_USER ) ? wfMessage( 'rev-deleted-user' )->text() : "[[{$contribs}/{$rev->getUserText()}|{$rev->getUserText()}]]"; + //Used for GENDER support for revreview-reject-summary-* + $lastRejectAuthor = $rev->getUserText(); } $lastTextId = $rev->getTextId(); } @@ -96,9 +98,13 @@ $comment = $this->form->getComment(); // convenience // Determine the default edit summary... - $oldRevAuthor = $oldRev->isDeleted( Revision::DELETED_USER ) - ? wfMessage( 'rev-deleted-user' )->text() - : $oldRev->getUserText(); + if ( $oldRev->isDeleted( Revision::DELETED_USER ) ) { + $oldRevAuthor = wfMessage( 'rev-deleted-user' )->text(); + $oldRevAuthorUsername = '.'; + } else { + $oldRevAuthor = $oldRev->getUserText(); + $oldRevAuthorUsername = $oldRevAuthor; + } // NOTE: *-cur msg wording not safe for (unlikely) edit auto-merge $msg = $newRev->isCurrent() ? 'revreview-reject-summary-cur' @@ -107,7 +113,10 @@ $wgContLang->formatNum( count( $rejectIds ) ), $wgContLang->listToText( $rejectAuthors ), $oldRev->getId(), - $oldRevAuthor )->inContentLanguage()->text(); + $oldRevAuthor, + count ( $rejectAuthors ) == 1 ? $lastRejectAuthor : '.', + $oldRevAuthorUsername)-> + numParams( count ( $rejectAuthors ) )->inContentLanguage()->text(); // If the message is too big, then fallback to the shorter one $colonSeparator = wfMessage( 'colon-separator' )->text(); $maxLen = 255 - count( $colonSeparator ) - count( $comment ); @@ -118,7 +127,8 @@ $defaultSummary = wfMessage( $msg, $wgContLang->formatNum( count( $rejectIds ) ), $oldRev->getId(), - $oldRevAuthor )->inContentLanguage()->text(); + $oldRevAuthor, + $oldRevAuthorUsername )->inContentLanguage()->text(); } // Append any review comment... if ( $comment != '' ) { diff --git a/frontend/language/RevisionReview.i18n.php b/frontend/language/RevisionReview.i18n.php index 4d258ff..a290acb 100644 --- a/frontend/language/RevisionReview.i18n.php +++ b/frontend/language/RevisionReview.i18n.php @@ -87,10 +87,10 @@ 'revreview-reject-summary' => 'Summary:', 'revreview-reject-confirm' => 'Reject these changes', 'revreview-reject-cancel' => 'Cancel', - 'revreview-reject-summary-cur' => 'Rejected the last {{PLURAL:$1|text change|$1 text changes}} (by $2) and restored revision $3 by $4', - 'revreview-reject-summary-old' => 'Rejected the first {{PLURAL:$1|text change|$1 text changes}} (by $2) that followed revision $3 by $4', - 'revreview-reject-summary-cur-short' => 'Rejected the last {{PLURAL:$1|text change|$1 text changes}} and restored revision $2 by $3', - 'revreview-reject-summary-old-short' => 'Rejected the first {{PLURAL:$1|text change|$1 text changes}} that followed revision $2 by $3', + 'revreview-reject-summary-cur' => 'Rejected the last {{PLURAL:$1|text change|$1 text changes}} ({{PLURAL:$7|{{GENDER:$5|by}}}} $2) and restored revision $3 {{GENDER:$6|by}} $4', + 'revreview-reject-summary-old' => 'Rejected the first {{PLURAL:$1|text change|$1 text changes}} ({{PLURAL:$7|{{GENDER:$5|by}}}} $2) that followed revision $3 {{GENDER:$6|by}} $4', + 'revreview-reject-summary-cur-short' => 'Rejected the last {{PLURAL:$1|text change|$1 text changes}} and restored revision $2 {{GENDER:$4|by}} $3', + 'revreview-reject-summary-old-short' => 'Rejected the first {{PLURAL:$1|text change|$1 text changes}} that followed revision $2 {{GENDER:$4|by}} $3', 'revreview-tt-flag' => 'Accept this revision by marking it as "checked"', 'revreview-tt-unflag' => 'Unaccept this revision by marking it as "unchecked"', @@ -328,28 +328,36 @@ 'revreview-reject-summary-cur' => '{{Flagged Revs-small}} Default summary shown when rejecting pending changes, and they are the latest revisions to a page * $1 - the number of rejected revisions -* $2 - the list of of one or more users whose changes are being rejected +* $2 - the list of one or more users whose changes are being rejected * $3 - the revision ID of the revision being reverted to -* $4 - the username or {{msg-mw|rev-deleted-user}} (if the user has been deleted)', +* $4 - the username or {{msg-mw|rev-deleted-user}} (if the user has been deleted) +* $5 - a plain text username of the user whose changes are being rejected or "." if multiple users, used for GENDER +* $6 - a plain text username of the author of the revision being reverted to, used for GENDER +* $7 - the number of users whose changes are being rejected, used for PLURAL', 'revreview-reject-summary-old' => '{{Flagged Revs-small}} Default summary shown when rejecting pending changes. * $1 - the number of rejected revisions * $2 - the list of (one or more) users who are being rejected * $3 - the revision ID of the revision before the first pending change -* $4 - the username or {{msg-mw|rev-deleted-user}} (if the user has been deleted)', +* $4 - the username or {{msg-mw|rev-deleted-user}} (if the user has been deleted) +* $5 - a plain text username of the user whose changes are being rejected or "." if multiple users, used for GENDER +* $6 - a plain text username of the author of the revision being reverted to, used for GENDER +* $7 - the number of users whose changes are being rejected, used for PLURAL', 'revreview-reject-summary-cur-short' => '{{Flagged Revs-small}} Default summary shown when rejecting pending changes, and they are the latest revisions to a page * $1 - the number of rejected revisions * $2 - the revision ID of the revision being reverted to -* $3 - the username or {{msg-mw|rev-deleted-user}} (if the user has been deleted)', +* $3 - the username or {{msg-mw|rev-deleted-user}} (if the user has been deleted) +* $4 - a plain text username of the author of the revision being reverted to, used for GENDER', 'revreview-reject-summary-old-short' => '{{Flagged Revs-small}} Default summary shown when rejecting pending changes. * $1 - the number of rejected revisions * $2 - the revision ID of the revision before the first pending change * $3 - the username or {{msg-mw|rev-deleted-user}} (if the user has been deleted) +* $4 - a plain text username of the author of the revision being reverted to, used for GENDER Alternative sentences which mean the same as the above message are: -* Rejected the next {{PLURAL:$1|change|$1 changes}} that followed revision $2 by $3 -* Rejected the {{PLURAL:$1|change|$1 changes}} that immediately followed revision $2 by $3', +* Rejected the next {{PLURAL:$1|change|$1 changes}} that followed revision $2 {{GENDER:$4|by}} $3 +* Rejected the {{PLURAL:$1|change|$1 changes}} that immediately followed revision $2 {{GENDER:$4|by}} $3', 'revreview-tt-flag' => '{{Flagged Revs}} Title attribute of the accept button on the review form.', 'revreview-tt-unflag' => '{{Flagged Revs}} -- To view, visit https://gerrit.wikimedia.org/r/103119 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0029ffa898120e529d095f8c1651dbcd1b3c9889 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FlaggedRevs Gerrit-Branch: master Gerrit-Owner: MegaAlex <alexivano...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits