Page MenuHomePhabricator

{{GENDER:}} returns current user's gender for IPs and disallowed usernames
Closed, ResolvedPublic

Description

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".


Version: unspecified
Severity: normal

Details

Reference
bz29450

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 21 2014, 11:37 PM
bzimport set Reference to bz29450.
bzimport added a subscriber: Unknown Object (MLST).

'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...

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.

(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.)

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?

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.

The question is whether IPs are always default-gender in every language.

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.

(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.

Closing to be reopened if someone sees a problem with this particular fix (when it is pushed or checked locally.