From bb07e068bf2567762ed5b7ffa1a46c5c86101585 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 28 Jul 2009 15:10:42 +0000 Subject: [PATCH] * (bug 14454) "Member of group(s)" in Special:Preferences causes language difficulties --- RELEASE-NOTES | 1 + includes/Preferences.php | 18 +++++++++++++----- languages/messages/MessagesEn.php | 5 +++-- languages/messages/MessagesQqq.php | 3 ++- maintenance/language/messages.inc | 1 + 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 39bf38381c..efd67533b0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -164,6 +164,7 @@ this. Was used when mwEmbed was going to be an extension. * (bug 10812) Interwiki links can have names and descriptions, fetched from message 'interwiki-desc-PREFIX', not really used anywhere yet though * (bug 9691) Add type (signup or login) parameter to AuthPlugin::ModifyUITemplate() +* (bug 14454) "Member of group(s)" in Special:Preferences causes language difficulties === Bug fixes in 1.16 === diff --git a/includes/Preferences.php b/includes/Preferences.php index f89990dd37..f5c2d02af8 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -110,22 +110,30 @@ class Preferences { # Get groups to which the user belongs $userEffectiveGroups = $user->getEffectiveGroups(); - $userEffectiveGroupsArray = array(); + $userGroups = $userMembers = array(); foreach( $userEffectiveGroups as $ueg ) { if( $ueg == '*' ) { // Skip the default * group, seems useless here continue; } - $userEffectiveGroupsArray[] = User::makeGroupLinkHTML( $ueg ); + $groupName = User::getGroupName( $ueg ); + $userGroups[] = User::makeGroupLinkHTML( $ueg, $groupName ); + + $memberName = User::getGroupMember( $ueg ); + $userMembers[] = User::makeGroupLinkHTML( $ueg, $memberName ); } - asort( $userEffectiveGroupsArray ); + asort( $userGroups ); + asort( $userMembers ); $defaultPreferences['usergroups'] = array( 'type' => 'info', 'label' => wfMsgExt( 'prefs-memberingroups', 'parseinline', - count( $userEffectiveGroupsArray ) ), - 'default' => $wgLang->commaList( $userEffectiveGroupsArray ), + $wgLang->formatNum( count($userGroups) ) ), + 'default' => wfMsgExt( 'prefs-memberingroups-type', array(), + $wgLang->commaList( $userGroups ), + $wgLang->commaList( $userMembers ) + ), 'raw' => true, 'section' => 'personal/info', ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 8c411299d7..a51ab67d51 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1758,6 +1758,7 @@ This cannot be undone.', 'username' => 'Username:', 'uid' => 'User ID:', 'prefs-memberingroups' => 'Member of {{PLURAL:$1|group|groups}}:', +'prefs-memberingroups-type' => '$1', 'prefs-registration' => 'Registration time:', 'prefs-registration-date-time' => '$1', # only translate this message to other languages if you have to change it 'yourrealname' => 'Real name:', @@ -4124,7 +4125,7 @@ Enter the filename without the "{{ns:file}}:" prefix.', 'htmlform-int-toolow' => 'The value you specified is below the minimum of $1', 'htmlform-int-toohigh' => 'The value you specified is above the maximum of $1', 'htmlform-submit' => 'Submit', -'htmlform-reset' => 'Undo changes', -'htmlform-selectorother-other' => 'Other', +'htmlform-reseta' => 'Undo changes', +'htmlform-selectorother-other' => 'Othera', ); diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 18653696e0..8943ba62f8 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -1104,7 +1104,8 @@ Shown as legend of the second fieldset of the tab 'Search' in [[Special:Preferen {{Identical|E-mail}}', 'username' => '{{Identical|Username}}', 'uid' => '{{Identical|User ID}}', -'prefs-memberingroups' => 'This message is shown on [[Special:Preferences]], first tab, where it is follwed by a colon.', +'prefs-memberingroups' => 'This message is shown on [[Special:Preferences]], first tab, where it is follwed by a colon. See also prefs-memberingroups-type.', +'prefs-memberingroups-type' => '$1 is list of group names, $2 is list of group member names. Label for these is prefs-memberingroups.', 'prefs-registration' => 'Used in [[Special:Preferences]].', 'prefs-registration-date-time' => '{{optional}} Used in [[Special:Preferences]]. Parameters are: diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index f8d32df928..99c85411e7 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -954,6 +954,7 @@ $wgMessageStructure = array( 'username', 'uid', 'prefs-memberingroups', + 'prefs-memberingroups-type', 'prefs-registration', 'prefs-registration-date-time', 'yourrealname', -- 2.20.1