Page MenuHomePhabricator

Hint under suggested pages is not localized for namespace Module
Open, LowPublic2 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to https://uk.wikipedia.org (for example)
  • Type in Module: (or Модуль:) in the search box
  • The suggested modules in the drop-down frame will have their hint (wikidata description) shown in English instead of Ukrainian (or any other local language)

Screenshot From 2025-07-03 06-25-07.png (1,020×200 px, 34 KB)

What should have happened instead?:

  • The hint should be localized, as it is for Template: or Category:

Screenshot From 2025-07-03 06-26-31.png (1,020×200 px, 39 KB)

Event Timeline

Restricted Application added subscribers: Base, Aklapper. · View Herald Transcript
pfischer subscribed.

Let's at least investigate what's causing this. Time box: 4h

dcausse added a project: MediaWiki-Engineering.
dcausse subscribed.

The central descriptions are obtained via the wikibase client in DescriptionLookup. My understanding is that the language is controlled by the page not the UI and for CodeContentHandler like Scribunto I suspect that they are hardcoded to english.

Tagging MediaWiki-Engineering for help on how to best triage this issue as it's not strictly related to the search backend but rather how descriptions are fetched and assembled by the rest search endpoint.

To confirm, we're talking about a MW REST API call like this:

https://uk.wikipedia.org/w/rest.php/v1/search/title?q=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:

Which results in a response like this (additional response entries snipped for brevity):

{
  "pages": [
  {
    "id": 2076851,
    "key": "Модуль:Languages/data",
    "title": "Модуль:Languages/data",
    "excerpt": "Модуль:Languages/data",
    "matched_title": null,
    "anchor": null,
    "description": "Wikimedia module",
    "thumbnail": null
  },

The issue is that the "description" field in that field should be localized, correct?

At a glance, it looks like the description value is provided by the onSearchResultProvideDescription hook (see buildDescriptionsFromPageIdentities), which may mean this needs to be addressed in the extension rather than in the core SearchHandler class. But that's just an initial impression from a one-minute glance over the code.

At a glance, it looks like the description value is provided by the onSearchResultProvideDescription hook (see buildDescriptionsFromPageIdentities), which may mean this needs to be addressed in the extension rather than in the core SearchHandler class. But that's just an initial impression from a one-minute glance over the code.

Thanks for looking into it @BPirkle, yes this is my understanding as well, but I wonder if the hook signature itself should be clarified to include what language it wants the descriptions? I have the impression that the core issue is that the description lookup is responsible for determining the descriptions language. It ends up using the page language, which can result in different languages when listing all the pages matching the search query (i.e. . CodeContentHandler are likely to be hard-coded to english, when other pages might simply fallback to the language of the site). I think I would find it more natural if all descriptions were returned in a single language and this language be controlled by the REST layer?

Gehel subscribed.

Removing Search as we expect this to be fixed in mw-core

aaron triaged this task as Low priority.Jul 7 2026, 1:07 AM