From d389ad1e2a2be4112f231bb92a49e9f44be06189 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Thu, 4 May 2006 22:48:47 +0000 Subject: [PATCH] * (bug 5587) Clean up the languages from references to the Groups special page ** Based on patch by Rotem Liss * Added new group-X and group-X-member messages --- RELEASE-NOTES | 2 ++ includes/SpecialListusers.php | 6 ++-- includes/User.php | 20 ++++++++++-- languages/Messages.php | 57 +++++++++-------------------------- 4 files changed, 37 insertions(+), 48 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d5cd4f7959..dc9dec69af 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -199,6 +199,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Special:Randompage now additionally accepts English namespace name as parameter * (bug 2981) Really fixed linktrail for Tamil (ta) * Disallow substituting Special pages when included into a page +* (bug 5587) Clean up the languages from references to the Groups special page +* Added new group-X and group-X-member messages == Compatibility == diff --git a/includes/SpecialListusers.php b/includes/SpecialListusers.php index 411d620ca7..a7379699ca 100644 --- a/includes/SpecialListusers.php +++ b/includes/SpecialListusers.php @@ -82,9 +82,9 @@ class ListUsersPage extends QueryPage { $out = wfElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) ); # Group drop-down list - $out .= wfElement( 'label', array( 'for' => 'group' ), wfMsg( 'groups-editgroup-name' ) ) . ' '; + $out .= wfElement( 'label', array( 'for' => 'group' ), wfMsg( 'group' ) ) . ' '; $out .= wfOpenElement( 'select', array( 'name' => 'group' ) ); - $out .= wfElement( 'option', array( 'value' => '' ), '(' . wfMsg( 'groupsall' ) . ')' ); # Item for "all groups" + $out .= wfElement( 'option', array( 'value' => '' ), wfMsg( 'group-all' ) ); # Item for "all groups" $groups = User::getAllGroups(); foreach( $groups as $group ) { $attribs = array( 'value' => $group ); @@ -185,7 +185,7 @@ class ListUsersPage extends QueryPage { 'ListUsersPage::formatResult' ); $groups = array(); while( $row = $dbr->fetchObject( $result ) ) { - $groups[] = User::getGroupName( $row->ug_group ); + $groups[] = User::getGroupMember( $row->ug_group ); } $dbr->freeResult( $result ); diff --git a/includes/User.php b/includes/User.php index 3e5afe3cde..d2f5501c2d 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1883,11 +1883,11 @@ class User { /** * @param string $group key name - * @return string localized descriptive name, if provided + * @return string localized descriptive name for group, if provided * @static */ function getGroupName( $group ) { - $key = "group-$group-name"; + $key = "group-$group"; $name = wfMsg( $key ); if( $name == '' || $name == "<$key>" ) { return $group; @@ -1896,6 +1896,22 @@ class User { } } + /** + * @param string $group key name + * @return string localized descriptive name for member of a group, if provided + * @static + */ + function getGroupMember( $group ) { + $key = "group-$group-member"; + $name = wfMsg( $key ); + if( $name == '' || $name == "<$key>" ) { + return $group; + } else { + return $name; + } + } + + /** * Return the set of defined explicit groups. * The * and 'user' groups are not included. diff --git a/languages/Messages.php b/languages/Messages.php index 2bf071ae5b..b238c8688e 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -729,38 +729,11 @@ $2 List redirects   Search for $3 $9", 'default' => 'default', 'files' => 'Files', -# User levels special page -# - -# switching pan -'groups-lookup-group' => 'Manage group rights', -'groups-group-edit' => 'Existing groups:', -'editgroup' => 'Edit Group', -'addgroup' => 'Add Group', - +# User rights 'userrights-lookup-user' => 'Manage user groups', 'userrights-user-editname' => 'Enter a username:', 'editusergroup' => 'Edit User Groups', -# group editing -'groups-editgroup' => 'Edit group', -'groups-addgroup' => 'Add group', -'groups-editgroup-preamble' => 'If the name or description starts with a colon, the -remainder will be treated as a message name, and hence the text will be localised -using the MediaWiki namespace', -'groups-editgroup-name' => 'Group name:', -'groups-editgroup-description' => 'Group description (max 255 characters):
', -'savegroup' => 'Save Group', -'groups-tableheader' => 'ID || Name || Description || Rights', -'groups-existing' => 'Existing groups', -'groups-noname' => 'Please specify a valid group name', -'groups-already-exists' => 'A group of that name already exists', -'addgrouplogentry' => 'Added group $2', -'changegrouplogentry' => 'Changed group $2', -'renamegrouplogentry' => 'Renamed group $2 to $3', - -# user groups editing -# 'userrights-editusergroup' => 'Edit user groups', 'saveusergroups' => 'Save User Groups', 'userrights-groupsmember' => 'Member of:', @@ -769,18 +742,18 @@ using the MediaWiki namespace', Unselected groups will not be changed. You can deselect a group with CTRL + Left Click', 'userrights-logcomment' => 'Changed group membership from $1 to $2', -# Default group names and descriptions -# -'group-anon-name' => 'Anonymous', -'group-anon-desc' => 'Anonymous users', -'group-loggedin-name' => 'User', -'group-loggedin-desc' => 'General logged in users', -'group-admin-name' => 'Administrator', -'group-admin-desc' => 'Trusted users able to block users and delete articles', -'group-bureaucrat-name' => 'Bureaucrat', -'group-bureaucrat-desc' => 'The bureaucrat group is able to make sysops', -'group-steward-name' => 'Steward', -'group-steward-desc' => 'Full access', +# Groups +'group' => 'Group:', +'group-bot' => 'Bots', +'group-sysop' => 'Sysops', +'group-bureaucrat' => 'Bureaucrats', +'group-steward' => 'Stewards', +'group-all' => '(all)', + +'group-bot-member' => 'Bot', +'group-sysop-member' => 'Sysop', +'group-bureaucrat-member' => 'Bureaucrat', +'group-steward-member' => 'Steward', # Recent changes @@ -1072,7 +1045,7 @@ Future changes to this page and its associated Talk page will be listed there, and the page will appear '''bolded''' in the [[Special:Recentchanges|list of recent changes]] to make it easier to pick out. -

If you want to remove the page from your watchlist later, click \"Unwatch\" in the sidebar.", +If you want to remove the page from your watchlist later, click \"Unwatch\" in the sidebar.", 'removedwatch' => 'Removed from watchlist', 'removedwatchtext' => "The page \"[[:$1]]\" has been removed from your watchlist.", 'watch' => 'Watch', @@ -1942,7 +1915,6 @@ is collapsed. Others will be hidden by default. 'watchlistall1' => 'all', 'watchlistall2' => 'all', 'namespacesall' => 'all', -'groupsall' => 'all', # E-mail address confirmation 'confirmemail' => 'Confirm E-mail address', @@ -2022,7 +1994,6 @@ Please confirm that really want to recreate this article.', # Separator for categories in page lists 'catseparator' => '|', - ); -- 2.20.1