Page MenuHomePhabricator

Wrong gender in $3 in [[MediaWiki:Flow-notification-mention-email-subject/en]]
Closed, ResolvedPublic

Description

In topic Incorrect gender in email of the Portuguese Wikipedia, User:CaiusSPQR is reporting that [[MediaWiki:Flow-notification-mention-email-subject/en]], with content:

$1 {{GENDER:$1|mentioned}} {{GENDER:$3|you}} on $2

is providing the wrong gender to $3. The message help states:

$1 - username of the person who mentions other users, can be used for GENDER
$3 - username of the person who receives the notification, can be used for GENDER

CaioSPQR defined the gender male, but the mention notifications that he receives refer to him as either male of female, depending on the gender of the person that mentioned him.

Event Timeline

JTannerWMF subscribed.

We think this is important to solve and we will work on this.

I just tried this myself on testwiki and it turns out that the email body uses the correct gender, but the subject line is wrong:

Subject: ‪Catrope‬ mencionou-a na wiki Wikipedia
Body: Catrope‬ mencionou-o na página de discussão dela em "‪Test‬".

The culprit appears to be:

"notification-mention-email-subject": "$1 {{GENDER:$1|mentioned}} {{GENDER:$2|you}} on {{SITENAME}}",

Which is documented as:

"notification-mention-email-subject": "Email subject. Parameters:\n* $1 - a username\n* $2 - name of the user viewing the notification, can be used for GENDER\nSee also:\n* {{msg-mw|Notification-mention-flyout}}",

And accordingly translated as:

"notification-mention-email-subject": "$1 {{GENDER:$1|mencionou-}}{{GENDER:$2|o|a|o(a)}} na wiki {{SITENAME}}",

But this is wrong. $2 is the username of the agent for gender, and the gender of the recipient isn't passed in at all.

(Note that this isn't Flow-related BTW. Flow mentions don't have a separate message for the email subject, so it falls back to the header message, which works correctly. The message the bug reporter quoted is an unused message that needs to be removed.)

Change 501424 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/Echo@master] Pass viewing user as $3 to email subject messages (for GENDER)

https://gerrit.wikimedia.org/r/501424

It turns out email subjects are a complete disaster gender-wise, and with the notable exception of Wikidata, no notification type or extension was getting this right. The patch above fixes the issue as reported, but there's a bunch more stuff to clean up, so it won't be the last patch on this task.

Change 501424 merged by jenkins-bot:
[mediawiki/extensions/Echo@master] Pass viewing user as $3 to email subject messages (for GENDER)

https://gerrit.wikimedia.org/r/501424

Etonkovidova claimed this task.