Page MenuHomePhabricator

[[MediaWiki:Revisionslider-label-username]] needs GENDER support
Closed, ResolvedPublic2 Estimated Story Points

Description

Can we have GENDER for 'user'/'username'/'edited by'? Probably with $1 as parameter.

The translation of the noun "username" is not gender-neutral in many languages, such as Portuguese (https://translatewiki.net/w/i.php?title=Special:SearchTranslations&filter=translated&group=mediawiki&grouppath=mediawiki&language=pt&query=username ).

The message was previously known as revisionslider-label-user or revisionslider-label-edited-by.


URL: https://translatewiki.net/wiki/MediaWiki:Revisionslider-label-user/en

Event Timeline

Tobi_WMDE_SW set the point value for this task to 2.Jun 2 2016, 2:36 PM
Tobi_WMDE_SW moved this task from Proposed to Backlog on the TCB-Team-Sprint-2016-06-02 board.

It turns out this is rather tricky in JavaScript. While in PHP you can just pass a username string to the GENDER function, in JS you need a user object (https://www.mediawiki.org/wiki/Manual:Messages_API#GENDER_in_JavaScript). I don't see a way of doing this without expensive requests per user or trying to work around it by loading this data upfront.

@Lea_WMDE After talking to @WMDE-leszek and @Addshore we came to the conclusion that there probably isn't a good solution for the problem I mentioned above. Would it be fine for the label to say "Username" instead of "User" to be gender neutral?

@Jakob_WMDE @WMDE-leszek @Addshore sounds good, but could you test in at least two appropriate languages if this would really solve the problem (i.e. not be Name des Nutzers)?

I believe "Benutzername" would be fine for German.
I've just checked what is used as a label for "Username" on the "Create a new account" page of Mediawiki and it uses userlogin-yourname message which does not use GENDER.
Also there several other places where (I believe as same as in our case, for performance reasons) the "username" label is not translated, etc. Special:Newpages page.
So we wouldn't be coming with something new by doing this.

For the qqq.json something similar for Mediawiki's userlogin-yourname could be used to it is clear that the label is not "genderizable":

"userlogin-yourname": "In user login & create account forms, label for username field.\n{{doc-important|<nowiki>{{</nowiki>[[Gender|GENDER]]<nowiki>}}</nowiki> is '''NOT''' supported.}}..."

Change 292549 had a related patch set uploaded (by Jakob):
Use username instead of user for tooltip label.

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

Hmm I looked a bit into translations, and the problem with username seems to be, that it translates e.g. in Spanish to nombre de usuario or nombre de usuaria depending on the gender, same for French and Portuguese .

Apart from that, the label is quite long, so I wonder what is common there. Would they only use nombre ? Or usuario / usuaria with gender ? Sorry to be the party pooper here but maybe the best solution is to avoid having a label there.

P.S.: Using name could also be an option.

Edited by won the Googlefight over edit by. So we will use that as gender-neutral label.

Change 292549 merged by Jakob:
Use a gender-neutral label for user.

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

Change 292549 merged by Jakob:
Use a gender-neutral label for user.

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

What makes you think that "Edited by" is gender neutral? It isn't necessarily.

What makes you think that "Edited by" is gender neutral? It isn't necessarily.

Hi @Nemo_bis,

thanks for looking into that. "Edited by" is gender neutral in English. We are at the point, where we don't claim to have an English label, that word by word translated is gender neutral in every language. That is up to the translators. The point is, that the description of the text in the qqq.json states, that the text should be gender-neutral giving a label for the user. It does not have to be a word by word translation.

I hope that helps addressing your concern.
Best, Fisch

Change 294066 had a related patch set uploaded (by Addshore):
Use username for username label

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

Change 294066 merged by WMDE-leszek:
Use username for username label

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

Apparently the message was renamed yet another time, now it's "revisionslider-label-username" (<strong>Username:</strong> [[$2|$1]]); but the problem is the same, no way to make translations grammatically correct based on the user's gender.

Nemo_bis renamed this task from [[MediaWiki:Revisionslider-label-user/en]] i18n issue to [[MediaWiki:Revisionslider-label-username]] needs GENDER support.Jul 24 2016, 8:50 PM
Nemo_bis reopened this task as Open.
Nemo_bis updated the task description. (Show Details)

Hi @Nemo_bis,

sadly, it is not possible to use GENDER in the username label in the tool-tips, without having a huge load of extra requests that would slow the extension down and possibly make it useless. :-/

Change 300881 had a related patch set uploaded (by WMDE-leszek):
Add support for GENDER to the username label in the tooltip

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

@Nemo_bis I am sorry to say there has been quite some confusion on our (WMDE) side related to this topic, and I was one of people who started it. My apologies for that.

We have completely misinterpreted the differences how client-side and server-side deal with GENDER magic word when we were first looking at this issue. Or at least I have.

It is not that bad as I/we thought that we need to query DB (through API) for each unique user that has edited a revision (which means in worst case up to 500 API calls) in order to create a mw.User object for each user that would be then passed to message function. This is not how mw.User is supposed to work.
It is embarrassing to admit but I only learned about https://www.mediawiki.org/wiki/API:Users today, and this is exactly a thing we need to have those "username"/"user" (be it a whatever label) messages GENDERized. As seen above, I've prepared a patch that should be sufficient (I have tested it with a strongly gender-marking language I speak and it worked as I'd have expected it).

Thank you for bringing this issue up again. Otherwise we would not have realized the mistake for a long time.

It's ok; one can only learn such i18n by using it. Next time, feel free to add Nikerabbit to reviewers to have someone double-check your i18n logic.

It's also useful if you point out where you looked for documentation/help on the matter, or where you would have expected to find something that you didn't find. The main docs are at https://www.mediawiki.org/wiki/Manual:Messages_API#GENDER_in_JavaScript but they may be incomplete or poorly linked.

Change 300881 merged by jenkins-bot:
Add support for GENDER to the username label in the tooltip

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

It looks as if this should have been deployed last week.