Last modified: 2011-06-20 21:56:37 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31450, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29450 - {{GENDER:}} returns current user's gender for IPs and disallowed usernames
{{GENDER:}} returns current user's gender for IPs and disallowed usernames
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-17 09:42 UTC by Amir E. Aharoni
Modified: 2011-06-20 21:56 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Amir E. Aharoni 2011-06-17 09:42:32 UTC
The message Blockipsuccesstext supports GENDER, but its actual implementation in the Hebrew Wikipedia is wrong: GENDER:$1 apparently refers to the gender of the blocking admin, not of the blocked user. When i block an IP, i get the female version when i have my gender set to female in the preferences. (I'm a guy, but i do it intentionally to find problems like this one :)

Another strange think is that MediaWiki:Blockipsuccesstext was deleted there in the Hebrew Wikipedia, so it is supposed to be equal to the message as it appears in MessagesHe.php, but actually it isn't.

And in the Hebrew Wikisource User:MediaWiki default deleted this message in 2007 with the summary "No longer required".
Comment 1 Sam Reed (reedy) 2011-06-17 11:28:39 UTC
'blockipsuccesstext'              => '[[Special:Contributions/$1|$1]] has been blocked.<br />
See [[Special:BlockList|IP block list]] to review blocks.',

'blockipsuccesstext'              => '{{GENDER:$1|המשתמש|המשתמשת}} [[Special:Contributions/$1|$1]] {{GENDER:$1|נחסם|נחסמה}}.

ראו את [[Special:BlockList|רשימת הכתובות החסומות]] כדי לצפות בחסימות.',


It would seem, we need to add a $2, which is the user doing the blocking

I've no idea if the $2 is the Username, or the gender though...
Comment 2 Amir E. Aharoni 2011-06-17 11:39:07 UTC
Reedy - this Hebrew string you cite the version in MessagesHe.php. As i wrote, the actual string at http://he.wikipedia.org/wiki/MediaWiki:blockipsuccesstext is somewhat different:

{{GENDER:$1|המשתמש|המשתמשת}} [[Special:Contributions/$1|$1]] {{GENDER:$1|נחסם|נחסמה}}.

ר' את [[Special:IPBlockList|רשימת הכתובות החסומות]] כדי לסקור חסימות.

Notice the last two words, for example. The difference is not big and it's not in the GENDER parts, but the fact that any difference exists at all is still quite puzzling: the message used to be customized in he.wikipedia, but the page was deleted and it's supposed to be identical to the string in MessagesHe.php. I don't know whether it's related to the problem i describe or a separate bug.
Comment 3 Amir E. Aharoni 2011-06-17 11:40:44 UTC
(In case the right-to-left writing makes it hard to understand what the last two words are, it's "לסקור חסימות" in he.wikipedia and "לצפות בחסימות" in MessagesHe.php.)
Comment 4 Max Semenik 2011-06-17 19:50:56 UTC
The cause is simple:

		// check parameter, or use the ParserOptions if in interface message
		$user = User::newFromName( $user );
		if ( $user ) {
			$gender = $user->getOption( 'gender' );
		} elseif ( $parser->getOptions()->getInterfaceMessage() ) {
			$gender = $parser->getOptions()->getUser()->getOption( 'gender' );
		}

you can't construct a User object for anons, hence current user's gender will be used. Same thing for impossible usernames, such as foo#bar.

Ideas what to do about it?
Comment 5 Amir E. Aharoni 2011-06-17 19:57:24 UTC
I don't know how to code it, but just get the default gender and not the current user's gender. Current user's gender has nothing to do with any other user's gender.
Comment 6 Max Semenik 2011-06-17 20:04:10 UTC
The question is whether IPs are always default-gender in every language.
Comment 7 Amir E. Aharoni 2011-06-17 20:10:16 UTC
In Hebrew the word "address" is feminine, but the word "user" is masculine. For other languages it may be different, of course.

I would prefer to have separate messages - one for users and one for IPs. If i understand correctly, currently Blockipsuccesstext is both for users and for IPs (despite its name). Please correct me if i'm wrong.
Comment 8 Niklas Laxström 2011-06-20 09:57:21 UTC
(In reply to comment #7)
> In Hebrew the word "address" is feminine, but the word "user" is masculine. For
> other languages it may be different, of course.
> 
> I would prefer to have separate messages - one for users and one for IPs. If i
> understand correctly, currently Blockipsuccesstext is both for users and for
> IPs (despite its name). Please correct me if i'm wrong.

Please open a new bug for that one.
Comment 9 Niklas Laxström 2011-06-20 10:05:15 UTC
Hopefully fixed in r90453.
Comment 10 Mark A. Hershberger 2011-06-20 21:56:37 UTC
Closing to be reopened if someone sees a problem with this particular fix (when it is pushed or checked locally.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links