Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1908,12 +1908,12 @@ |
1909 | 1909 | 'group-suppress' => 'Oversights', |
1910 | 1910 | 'group-all' => '(all)', |
1911 | 1911 | |
1912 | | -'group-user-member' => 'user', |
1913 | | -'group-autoconfirmed-member' => 'autoconfirmed user', |
1914 | | -'group-bot-member' => 'bot', |
1915 | | -'group-sysop-member' => 'administrator', |
1916 | | -'group-bureaucrat-member' => 'bureaucrat', |
1917 | | -'group-suppress-member' => 'oversight', |
| 1912 | +'group-user-member' => '{{GENDER:$1|user}}', |
| 1913 | +'group-autoconfirmed-member' => '{{GENDER:$1|autoconfirmed user}}', |
| 1914 | +'group-bot-member' => '{{GENDER:$1|bot}}', |
| 1915 | +'group-sysop-member' => '{{GENDER:$1|administrator}}', |
| 1916 | +'group-bureaucrat-member' => '{{GENDER:$1|bureaucrat}}', |
| 1917 | +'group-suppress-member' => '{{GENDER:$1|oversight}}', |
1918 | 1918 | |
1919 | 1919 | 'grouppage-user' => '{{ns:project}}:Users', |
1920 | 1920 | 'grouppage-autoconfirmed' => '{{ns:project}}:Autoconfirmed users', |
Index: trunk/phase3/includes/specials/SpecialUserrights.php |
— | — | @@ -450,7 +450,7 @@ |
451 | 451 | wfMessage( 'editinguser' )->params( wfEscapeWikiText( $user->getName() ) )->rawParams( $userToolLinks )->parse() . |
452 | 452 | wfMsgExt( 'userrights-groups-help', array( 'parse' ) ) . |
453 | 453 | $grouplist . |
454 | | - Xml::tags( 'p', null, $this->groupCheckboxes( $groups ) ) . |
| 454 | + Xml::tags( 'p', null, $this->groupCheckboxes( $groups, $user ) ) . |
455 | 455 | Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-userrights-table-outer' ) ) . |
456 | 456 | "<tr> |
457 | 457 | <td class='mw-label'>" . |
— | — | @@ -501,7 +501,7 @@ |
502 | 502 | * @param $usergroups Array: groups the user belongs to |
503 | 503 | * @return string XHTML table element with checkboxes |
504 | 504 | */ |
505 | | - private function groupCheckboxes( $usergroups ) { |
| 505 | + private function groupCheckboxes( $usergroups, $user ) { |
506 | 506 | $allgroups = $this->getAllGroups(); |
507 | 507 | $ret = ''; |
508 | 508 | |
— | — | @@ -549,11 +549,11 @@ |
550 | 550 | foreach( $column as $group => $checkbox ) { |
551 | 551 | $attr = $checkbox['disabled'] ? array( 'disabled' => 'disabled' ) : array(); |
552 | 552 | |
| 553 | + $member = User::getGroupMember( $group, $user->getName() ); |
553 | 554 | if ( $checkbox['irreversible'] ) { |
554 | | - $text = htmlspecialchars( wfMsg( 'userrights-irreversible-marker', |
555 | | - User::getGroupMember( $group ) ) ); |
| 555 | + $text = wfMessage( 'userrights-irreversible-marker', $member )->escaped(); |
556 | 556 | } else { |
557 | | - $text = htmlspecialchars( User::getGroupMember( $group ) ); |
| 557 | + $text = htmlspecialchars( $member ); |
558 | 558 | } |
559 | 559 | $checkboxHtml = Xml::checkLabel( $text, "wpGroup-" . $group, |
560 | 560 | "wpGroup-" . $group, $checkbox['set'], $attr ); |
Index: trunk/phase3/includes/specials/SpecialListusers.php |
— | — | @@ -135,7 +135,7 @@ |
136 | 136 | if( count( $groups_list ) > 0 ) { |
137 | 137 | $list = array(); |
138 | 138 | foreach( $groups_list as $group ) |
139 | | - $list[] = self::buildGroupLink( $group ); |
| 139 | + $list[] = self::buildGroupLink( $group, $userPage->getText() ); |
140 | 140 | $groups = $this->getLang()->commaList( $list ); |
141 | 141 | } else { |
142 | 142 | $groups = ''; |
— | — | @@ -263,11 +263,8 @@ |
264 | 264 | * @param $group String: group name |
265 | 265 | * @return string |
266 | 266 | */ |
267 | | - protected static function buildGroupLink( $group ) { |
268 | | - static $cache = array(); |
269 | | - if( !isset( $cache[$group] ) ) |
270 | | - $cache[$group] = User::makeGroupLinkHtml( $group, htmlspecialchars( User::getGroupMember( $group ) ) ); |
271 | | - return $cache[$group]; |
| 267 | + protected static function buildGroupLink( $group, $username ) { |
| 268 | + return User::makeGroupLinkHtml( $group, htmlspecialchars( User::getGroupMember( $group, $username ) ) ); |
272 | 269 | } |
273 | 270 | } |
274 | 271 | |
Index: trunk/phase3/includes/specials/SpecialActiveusers.php |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | if ( isset( $this->groups[$group] ) ) { |
126 | 126 | return; |
127 | 127 | } |
128 | | - $list[] = self::buildGroupLink( $group ); |
| 128 | + $list[] = self::buildGroupLink( $group, $userName ); |
129 | 129 | } |
130 | 130 | $groups = $this->getLang()->commaList( $list ); |
131 | 131 | |
Index: trunk/phase3/includes/User.php |
— | — | @@ -3562,10 +3562,11 @@ |
3563 | 3563 | * Get the localized descriptive name for a member of a group, if it exists |
3564 | 3564 | * |
3565 | 3565 | * @param $group String Internal group name |
| 3566 | + * @param $username String Username for gender (since 1.19) |
3566 | 3567 | * @return String Localized name for group member |
3567 | 3568 | */ |
3568 | | - public static function getGroupMember( $group ) { |
3569 | | - $msg = wfMessage( "group-$group-member" ); |
| 3569 | + public static function getGroupMember( $group, $username = '#' ) { |
| 3570 | + $msg = wfMessage( "group-$group-member", $username ); |
3570 | 3571 | return $msg->isBlank() ? $group : $msg->text(); |
3571 | 3572 | } |
3572 | 3573 | |
Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -159,7 +159,7 @@ |
160 | 160 | $groupName = User::getGroupName( $ueg ); |
161 | 161 | $userGroups[] = User::makeGroupLinkHTML( $ueg, $groupName ); |
162 | 162 | |
163 | | - $memberName = User::getGroupMember( $ueg ); |
| 163 | + $memberName = User::getGroupMember( $ueg, $user->getName() ); |
164 | 164 | $userMembers[] = User::makeGroupLinkHTML( $ueg, $memberName ); |
165 | 165 | } |
166 | 166 | asort( $userGroups ); |