Merge "Add GENDER support to protection null revision edit summary"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 4 Nov 2016 06:13:20 +0000 (06:13 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 4 Nov 2016 06:13:20 +0000 (06:13 +0000)
includes/page/WikiPage.php
languages/i18n/en.json
languages/i18n/qqq.json

index b72f7bd..dd78d19 100644 (file)
@@ -2485,13 +2485,13 @@ class WikiPage implements Page, IDBAccessObject {
                }
 
                if ( !$protect ) { // No protection at all means unprotection
-                       $revCommentMsg = 'unprotectedarticle';
+                       $revCommentMsg = 'unprotectedarticle-comment';
                        $logAction = 'unprotect';
                } elseif ( $isProtected ) {
-                       $revCommentMsg = 'modifiedarticleprotection';
+                       $revCommentMsg = 'modifiedarticleprotection-comment';
                        $logAction = 'modify';
                } else {
-                       $revCommentMsg = 'protectedarticle';
+                       $revCommentMsg = 'protectedarticle-comment';
                        $logAction = 'protect';
                }
 
@@ -2675,16 +2675,14 @@ class WikiPage implements Page, IDBAccessObject {
        public function insertProtectNullRevision( $revCommentMsg, array $limit,
                array $expiry, $cascade, $reason, $user = null
        ) {
-               global $wgContLang;
                $dbw = wfGetDB( DB_MASTER );
 
                // Prepare a null revision to be added to the history
-               $editComment = $wgContLang->ucfirst(
-                       wfMessage(
-                               $revCommentMsg,
-                               $this->mTitle->getPrefixedText()
-                       )->inContentLanguage()->text()
-               );
+               $editComment = wfMessage(
+                       $revCommentMsg,
+                       $this->mTitle->getPrefixedText(),
+                       $user ? $user->getName() : ''
+               )->inContentLanguage()->text();
                if ( $reason ) {
                        $editComment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $reason;
                }
index a59622d..8ac4089 100644 (file)
        "modifiedarticleprotection": "changed protection level for \"[[$1]]\"",
        "unprotectedarticle": "removed protection from \"[[$1]]\"",
        "movedarticleprotection": "moved protection settings from \"[[$2]]\" to \"[[$1]]\"",
+       "protectedarticle-comment": "{{GENDER:$2|Protected}} \"[[$1]]\"",
+       "modifiedarticleprotection-comment": "{{GENDER:$2|Changed protection level}} for \"[[$1]]\"",
+       "unprotectedarticle-comment": "{{GENDER:$2|Removed protection}} from \"[[$1]]\"",
        "protect-title": "Change protection level for \"$1\"",
        "protect-title-notallowed": "View protection level of \"$1\"",
        "prot_1movedto2": "[[$1]] moved to [[$2]]",
index c8548ba..5d01666 100644 (file)
        "modifiedarticleprotection": "This is a ''logentry'' message only used on IRC.\nText describing an action. $1 is a page title.",
        "unprotectedarticle": "This is a ''logentry'' message only used on IRC.\nUsed as action. Parameters:\n* $1 - target page title",
        "movedarticleprotection": "This is a ''logentry'' message only used on IRC. It appears in the log if a protected page is renamed.\n\nExample:\n<code>00:51, 16 September 2010 Siebrand +(Talk • contribs • block) moved protection settings from \"User:Siebrand/prot-move\" to \"User:Siebrand/prot-moved\" ‎ (User:Siebrand/prot-move moved to User:Siebrand/prot-moved: prot_move test.)</code>\n\nParameters:\n* $1 - target page title\n* $2 - source page title",
+       "protectedarticle-comment": "Used as part of the edit summary placed in the page history when a page is protected.\n\nParameters:\n* $1 - page title\n* $2 - user who carried out the action (should only be used in the <code>GENDER</code> magic word)",
+       "modifiedarticleprotection-comment": "Used as part of the edit summary placed in the page history when a page's protection settings are modified.\n\nParameters:\n* $1 - page title\n* $2 - user who carried out the action (should only be used in the <code>GENDER</code> magic word)",
+       "unprotectedarticle-comment": "Used as part of the edit summary placed in the page history when a page is unprotected.\n\nParameters:\n* $1 - page title\n* $2 - user who carried out the action (should only be used in the <code>GENDER</code> magic word)",
        "protect-title": "Title for the protection form. $1 is the title of the page to be (un)protected.",
        "protect-title-notallowed": "Same as {{msg-mw|Protect-title}}, but when the user does not have the right to change protection levels.\n\nParameters:\n* $1 - page title",
        "prot_1movedto2": "Message description: [[mw:Manual:Interface/1movedto2]]\n\nParameters:\n* $1 - source page title\n* $2 - target page title",