MediaWiki r41737 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r41736‎ | r41737 (on ViewVC)‎ | r41738 >
Date:09:16, 6 October 2008
Author:werdna
Status:old (Comments)
Tags:todo 
Comment:
(bug 15301) Fix up use of actions in display for permissions errors.
Modified paths:

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
===================================================================
--- trunk/phase3/maintenance/language/messages.inc	(revision 41736)
+++ trunk/phase3/maintenance/language/messages.inc	(revision 41737)
@@ -971,6 +971,39 @@
 		'rightslogentry',
 		'rightsnone',
 	),
+	'action' => array(
+		'action-read',
+		'action-edit',
+		'action-createpage',
+		'action-createtalk',
+		'action-createaccount',
+		'action-minoredit',
+		'action-move',
+		'action-move-subpages',
+		'action-upload',
+		'action-reupload',
+		'action-reupload-shared',
+		'action-upload_by_url',
+		'action-writeapi',
+		'action-delete',
+		'action-deleterevision',
+		'action-deletedhistory',
+		'action-browsearchive',
+		'action-undelete',
+		'action-suppressrevision',
+		'action-suppressionlog',
+		'action-block',
+		'action-protect',
+		'action-import',
+		'action-importupload',
+		'action-patrol',
+		'action-autopatrol',
+		'action-unwatchedpages',
+		'action-trackback',
+		'action-mergehistory',
+		'action-userrights',
+		'action-userrights-interwiki',
+	),
 	'recentchanges' => array(
 		'nchanges',
 		'recentchanges',
Index: trunk/phase3/includes/OutputPage.php
===================================================================
--- trunk/phase3/includes/OutputPage.php	(revision 41736)
+++ trunk/phase3/includes/OutputPage.php	(revision 41737)
@@ -1185,8 +1185,7 @@
 			$text = wfMsgNoTrans( 'permissionserrorstext', count($errors)). "\n\n";
 		} else {
 			global $wgLang;
-			$action_desc = wfMsg( "right-$action" );
-			$action_desc = $wgLang->lcfirst( $action_desc ); // FIXME: TERRIBLE HACK
+			$action_desc = wfMsg( "action-$action" );
 			$text = wfMsgNoTrans( 'permissionserrorstext-withaction', count($errors), $action_desc ) . "\n\n";
 		}
 
Index: trunk/phase3/languages/messages/MessagesEn.php
===================================================================
--- trunk/phase3/languages/messages/MessagesEn.php	(revision 41736)
+++ trunk/phase3/languages/messages/MessagesEn.php	(revision 41737)
@@ -1643,6 +1643,40 @@
 'right-userrights-interwiki' => 'Edit user rights of users on other wikis',
 'right-siteadmin'            => 'Lock and unlock the database',
 
+# Associated actions - in the sentence "You don't have permission to X"
+'action-read'                 => 'read this page',
+'action-edit'                 => 'edit this page',
+'action-createpage'           => 'create pages',
+'action-createtalk'           => 'create discussion pages',
+'action-createaccount'        => 'create this user account',
+'action-minoredit'            => 'mark this edit as minor',
+'action-move'                 => 'move this page',
+'action-move-subpages'        => 'move this page, and its subpages',
+'action-upload'               => 'upload this file',
+'action-reupload'             => 'overwrite this existing file',
+'action-reupload-shared'      => 'override this file on a shared repository',
+'action-upload_by_url'        => 'upload this file from a URL address',
+'action-writeapi'             => 'use the write API',
+'action-delete'               => 'delete this page',
+'action-deleterevision'       => 'delete this revision',
+'action-deletedhistory'       => "view this page's deleted history",
+'action-browsearchive'        => 'search deleted pages',
+'action-undelete'             => 'undelete this page',
+'action-suppressrevision'     => 'review and restore this hidden revision',
+'action-suppressionlog'       => 'view this private log',
+'action-block'                => 'block this user from editing',
+'action-protect'              => 'change protection levels for this page',
+'action-import'               => 'import this page from another wiki',
+'action-importupload'         => 'import this page from a file upload',
+'action-patrol'               => "mark others' edit as patrolled",
+'action-autopatrol'           => "have your edit marked as patrolled",
+'action-unwatchedpages'       => 'view the list of unwatched pages',
+'action-trackback'            => 'submit a trackback',
+'action-mergehistory'         => 'merge the history of this page',
+'action-userrights'           => 'edit all user rights',
+'action-userrights-interwiki' => 'edit user rights of users on other wikis',
+'action-siteadmin'            => 'lock or unlock the database',
+
 # User rights log
 'rightslog'      => 'User rights log',
 'rightslogtext'  => 'This is a log of changes to user rights.',

Comments

#Comment by Brion VIBBER (Talk | contribs)   02:52, 20 October 2008

Looks ok, though i'm not super fond of the near-duplication of text required... plus it doesn't seem to extend clearly to new rights.

#Comment by Werdna (Talk | contribs)   13:46, 20 October 2008

Siebrand always tells us that messages aren't lego :-).

As for new rights, it's to do with new actions, not new rights. I just found rights as a reasonable starting point. Of course, with most new actions, come new rights...

Status & tagging log

  • 15:32, 12 September 2011 Meno25 (Talk | contribs) changed the status of r41737 [removed: ok added: old]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox