From: This, that and the other Date: Fri, 11 Dec 2015 08:26:05 +0000 (+1100) Subject: Add GENDER support to protection null revision edit summary X-Git-Tag: 1.31.0-rc.0~4956^2 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=1cdc94f24960bd896593b9d5f2ced1e39e51e53e;p=lhc%2Fweb%2Fwiklou.git Add GENDER support to protection null revision edit summary The edit summary for protection null revisions are still messy "Lego messages", but now with GENDER support. The message documentation (qqq) for "protectedarticle", "modifiedarticleprotection", and "unprotectedarticle" was incorrect, but now matches the fact that these are IRC-only messages. Bug: T121091 Change-Id: Ia1151fb5aab8334d3351588531fcdac499fcc486 --- diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 294a22c802..23e0887cbb 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -2444,13 +2444,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'; } @@ -2627,16 +2627,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; } diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 70a2b805b7..e756ed06eb 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2017,6 +2017,9 @@ "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]]", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index fc72a4b281..7be67cf6b6 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2192,6 +2192,9 @@ "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:\n00: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.)\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 GENDER 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 GENDER 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 GENDER 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",