Page MenuHomePhabricator

Investigation: Check how we could re-name ( female ) gendered categories on save
Open, LowPublic

Description

People might start using female gendered categories when they see them on the article pages. It might be possible to "reverse" change that label on save so that it uses the generic masculine form.

  • Figure out a way how to change the category name on save
  • If editors ( like VE ) use an auto suggest function ( I do not know atm ) figure out if these could use gendered category labels

Event Timeline

WMDE-Fisch triaged this task as Low priority.Jul 15 2019, 11:06 AM
awight added a subscriber: awight.EditedJul 16 2019, 8:56 AM

I've heard anecdotally that most editors add categories with the HotCat gadget, rather than in wikitext or VisualEditor. I can't find proof of that right now, but going on this hunch I think we should include it in our investigation.

use commonswiki;
select count(*) from user join user_properties on user_id = up_user where up_property = 'gadget-HotCat';
61886

use dewiki; ...
51892

VisualEditor does have autocomplete for categories, and it uses the action=query&generator=allcategories API. Once a category is selected, an additional call is made to action=query&prop=pageprops, to determine whether the category is hidden or not.

HotCat uses different APIs: action=opensearch&namespace=14 and action=query&list=allpages are both called for each autocomplete iteration, and to pull information about the final selection.

Saves are performed using the action=submit API, and action=visualeditoredit. We would want to intercept these with a server-side hook, maybe ArticlePrepareTextForEdit which gives us the WikiPage, but I think we'll have to parse and find the categories which sounds very expensive.

We'll also need to intercept and modify the content when displaying a preview (twice, an unaliasing and then reasliasing!) or when previewing changes. This would be through the EditPageGetPreviewContent and EditPageGetDiffContent hooks.

From https://commons.wikimedia.org/wiki/Help:Gadget-HotCat ,

HotCat tries to automatically resolve redirects between categories when the "OK"-button is clicked (or when a suggestion is double-clicked). If the selected category X is a redirect to another category Y, HotCat will automatically add the category Y instead of X.

I think this is too gross to actually do, but we could have the API return a fake redirect result when a gendered category is queried...

Sounds good and definitely ways to hack ourselves into the system "faking" that certain categories exist.

It just came to my mind, that we probably also should always automatically add the ( configurable ) Frau category so that the article has everything needed for the right display. Doing all that, there probably should also be some kind of note, what magically happened in the background so people do not get too confused...