r107882 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107881‎ | r107882 | r107883 >
Date:12:48, 3 January 2012
Author:hashar
Status:resolved (Comments)
Tags:
Comment:
Fix gender on Special:Userrights

r99312 added gender supports to group message. On Special:Userrights, messages
were not passed the username for GENDER support.

This patch update the French localisation as an example.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUserrights.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesFr.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesQqq.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/messages/MessagesQqq.php
@@ -1480,7 +1480,9 @@
14811481 'editinguser' => 'Appears on [[Special:UserRights]]. Parameters:
14821482 * $1 is a username
14831483 * $2 are user tool links. Example: "(Talk | contribs | block | send e-mail)".',
1484 -'userrights-editusergroup' => '{{Identical|Edit user groups}}',
 1484+'userrights-editusergroup' => '{{Identical|Edit user groups}}. Parameter:
 1485+* $1 is a username - optional, can be used for GENDER
 1486+',
14851487 'saveusergroups' => 'Button text when editing user groups',
14861488 'userrights-groupsmember' => 'Used when editing user groups in [[Special:Userrights]]. The messsage is followed by a list of group names.
14871489
@@ -1491,7 +1493,9 @@
14921494
14931495 Parameters:
14941496 * $1 - optional, for PLURAL use, the number of items in the list following the message. Please avoid PLURAL, if your language can do without.',
1495 -'userrights-groups-help' => 'Instructions displayed on [[Special:UserRights]].',
 1497+'userrights-groups-help' => 'Instructions displayed on [[Special:UserRights]]. Parameters:
 1498+* $1 is a username - optional, can be used for GENDER
 1499+',
14961500 'userrights-reason' => 'Text beside log field when editing user groups
14971501
14981502 {{Identical|Reason}}',
Index: trunk/phase3/languages/messages/MessagesFr.php
@@ -1494,14 +1494,14 @@
14951495 'userrights-lookup-user' => 'Gestion des groupes d’utilisateurs',
14961496 'userrights-user-editname' => 'Entrez un nom d’utilisateur :',
14971497 'editusergroup' => 'Modification des groupes d’utilisateurs',
1498 -'editinguser' => "Modification des droits de l’utilisateur '''[[User:$1|$1]]''' $2",
1499 -'userrights-editusergroup' => 'Modifier les groupes de l’utilisateur',
 1498+'editinguser' => "Modification des droits de l’{{GENDER:$1|utilisateur|utilisatrice}} '''[[User:$1|$1]]''' $2",
 1499+'userrights-editusergroup' => 'Modifier les groupes de l’{{GENDER:$1|utilisateur|utilisatrice}}',
15001500 'saveusergroups' => 'Enregistrer les groupes de l’utilisateur',
15011501 'userrights-groupsmember' => 'Membre de :',
15021502 'userrights-groupsmember-auto' => 'Membre implicite de :',
1503 -'userrights-groups-help' => 'Vous pouvez modifier les groupes auxquels appartient cet utilisateur.
1504 -* Une case cochée signifie que l’utilisateur se trouve dans ce groupe.
1505 -* Une case non cochée signifie qu’il ne s’y trouve pas.
 1503+'userrights-groups-help' => 'Vous pouvez modifier les groupes auxquels appartient cet {{GENDER:$1|utilisateur|utilisatrice}}.
 1504+* Une case cochée signifie que l’{{GENDER:$1|utilisateur|utilisatrice}} se trouve dans ce groupe.
 1505+* Une case non cochée signifie qu’{{GENDER:$1|il|elle}} ne s’y trouve pas.
15061506 * Un astérisque (*) indique que vous ne pouvez pas retirer ce groupe une fois que vous l’avez ajouté.',
15071507 'userrights-reason' => 'Motif :',
15081508 'userrights-no-interwiki' => 'Vous n’avez pas la permission de modifier des droits d’utilisateurs sur d’autres wikis.',
Index: trunk/phase3/includes/specials/SpecialUserrights.php
@@ -441,9 +441,9 @@
442442 Html::hidden( 'user', $this->mTarget ) .
443443 Html::hidden( 'wpEditToken', $this->getUser()->getEditToken( $this->mTarget ) ) .
444444 Xml::openElement( 'fieldset' ) .
445 - Xml::element( 'legend', array(), wfMsg( 'userrights-editusergroup' ) ) .
 445+ Xml::element( 'legend', array(), wfMessage( 'userrights-editusergroup', $user->getName() ) ) .
446446 wfMessage( 'editinguser' )->params( wfEscapeWikiText( $user->getName() ) )->rawParams( $userToolLinks )->parse() .
447 - wfMsgExt( 'userrights-groups-help', array( 'parse' ) ) .
 447+ wfMessage( 'userrights-groups-help', $user->getName() ) .
448448 $grouplist .
449449 Xml::tags( 'p', null, $this->groupCheckboxes( $groups, $user ) ) .
450450 Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-userrights-table-outer' ) ) .

Follow-up revisions

RevisionCommit summaryAuthorDate
r107931Followup r107882: explicitly say text() or parse() on wfMessage() calls!brion19:44, 3 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99312Part of bug 31503 - Allow gender distinction also for user groupsnikerabbit14:13, 8 October 2011

Comments

#Comment by Duplicatebug (talk | contribs)   13:23, 3 January 2012

Please do not rely on implicit toString of wfMessage.

See bug 17348 and bug 31564

#Comment by Brion VIBBER (talk | contribs)   19:46, 3 January 2012

Made explicit again in r107931.

Status & tagging log