Page MenuHomePhabricator

Re-use Wikifunctions's page-level language component to let the user set their render/view language
Closed, ResolvedPublic

Description

Description

Incorporate language selector to Abstract Wikipedia content and special pages, following Wikifunctions behavior, described below:


Wikifunctions behavior

Wikifunctions language selector module ext.wikilambda.languageselector replaces ULS at the top level of the page:


Implementation details

class: HookHandler/PageRenderingHandler.php
hooks: onSkinTemplateNavigation__Universal, onHtmlPageLinkRendererEnd
docs:

Currently this hook is used to rewrite the skin links for ZObject content pages and exits early when the content model is not ZOBJECT:

90     // The rest of this function is about rewriting skin links on ZObject pages         
91     $targetTitle = $skinTemplate->getRelevantTitle();                                   
92                                                                                         
93     if ( !$targetTitle || !$targetTitle->hasContentModel( CONTENT_MODEL_ZOBJECT ) ) {   
94       // Nothing to do, exit.                                                           
95       return;                                                                           
96     }

We should add the necessary behavior here when content model is CONTENT_MODEL_ABSTRACT, which probably is the same one that for ZObjects rewrites urls by adding the uselang


Desired behavior/Acceptance criteria

  • On Abstract content and special pages, users can select a MW language in the same selector
  • Once selected, page will be redirected to uselang=<lang>
  • Links should inherit the uselang url property (e.g. from Read page with uselang=es, when clicking "Edit" link, should take to edit page with uselang=es)
  • Vue app (e.g. view/read pages, Special:CreateAbstract page, etc.) should gathered language code and language zid properly

Completion checklist

Event Timeline

@Jdforrester-WMF @ecarg Looking into the current state of our language selector with Abstract content pages, it looks like many things works out of the box, except for the inheritance of the uselang url prop throughout links.

A question for @Jdforrester-WMF, just to refresh context. When looking into this component, I see we are doing a very inefficient search and faulty through languages, but we choose language codes over MW languages, we don't really care about zobjects in this module. Do you remember why we chose to create this selector instead of reusing ULS?

This comment has been deleted.

I don't think the scope for this covers HtmlPageLinkRendererEnd, which is generally only used in very minor places and not a priority for the MVP.

Change #1239493 had a related patch set uploaded (by Ecarg; author: Ecarg):

[mediawiki/extensions/WikiLambda@master] Abstract Content should use the same language component as Wikifunctions for page-level rendering

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

Jdforrester-WMF changed the task status from Open to In Progress.Feb 17 2026, 2:45 PM
Jdforrester-WMF assigned this task to ecarg.

On talk pages: I am inclined to create a separate task for this

Change #1239493 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Abstract Content should use the same language component as Wikifunctions for page-level rendering

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

Jdforrester-WMF updated the task description. (Show Details)