Page MenuHomePhabricator

mw.Title.getNamespacePrefix() does not consider namespaceGenderAliases
Closed, DeclinedPublic

Description

When using a mw.Title object on a user page with a gendered namespace alias ( e.g. female Benutzerin: vs male Benutzer: on de-lang Mediwikis ) mw.Title.getNamespacePrefix() returns the default i18n namespace instead of the gendered one.

Due to that mw.Title.getPrefixedDb() differs from the output of mw.config.get( 'wgPageName' ) although it would be expected to be the same when mw.Title is created from the current page.

Event Timeline

Related issue: T204610: Expose gender of gendered namespace aliases in siteinfo API.

Would like to report that female users of Convenient-Discussions are generally unhappy to see the masculine noun when the script has to refer to their user page names.

Krinkle renamed this task from mw.Title.getNamespacePrefix() does not work with namespaceGenderAliases to mw.Title.getNamespacePrefix() does not consider namespaceGenderAliases.Aug 9 2021, 10:04 PM

What is the actual problem here? I think requesting support for this would be declined as too expensive and not worth the performance cost unless there is a really good use case for why this matters in client-side logic.

As I understand it, the client library only produces URLs (which work fine either way and aren't generally user-facing, once followed the server normalises/redirects these accordingly for display in the address bar), and facilitates parsing and comparing of titles, which should work fine as well.

There are many cases where the non-canonical representation may vary, but why is this an issue? I am asking because I want to help solve the underlying problem. I respect the gender recognisation, but believe the root cause here is most likely incorrect use of mw.Title, and thus understanding where and how it is used, will likely lead to an existing solution that is more appropiate for that use case.

Declining for now, but feel free to answer the above and I'll keep at it / re-open as needed.