Page MenuHomePhabricator

Card labels fall back to raw Q-IDs when an item has no Hindi label on Wikidata
Open, In Progress, HighPublic4 Estimated Story Points

Description

Summary

New Article Moto G4 (26).png (1,080×1,920 px, 200 KB)

Once a solution for T424641 is in place and the search starts surfacing items that exist on Wikidata but have no Hindi label, those items will render on the result cards as raw Q-IDs instead of a readable name.

Potential solution

t424830-message-mobile-hindicopy.png (780×1,688 px, 223 KB)

Show a fallback label when the Hindi label is missing, and surface a small message letting the user know.

A few points worth keeping in consideration:

  • Mixed results. Show the message only when at least one displayed result uses a fallback label from another language. Do not show it for mul labels, since those are shared labels rather than missing local labels
  • Fallback chain. Rather than jumping straight to English, walk the MediaWiki standard language fallback chain (so e.g. a Hindi user might see Sanskrit before English, depending on the wiki's configuration).

Message string (placeholder): "Some results are shown in another language"

Event Timeline

Pginer-WMF moved this task from Backlog to Prioritized on the LPL Hypothesis board.
This comment was removed by SBisson.

Change #1279446 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ArticleGuidance@master] wbgetentities: use languagefallback=1

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

@SGautam_WMF

Mixed results. A search can return some items with Hindi labels and some without. The message should only appear when at least one item actually falls back, and it should make clear that *some* names aren't available, not all of them.

It is not always obvious if the label is missing for a language. Some items use the lang code "mul" to indicate that a label can be used for any language unless explicitly redefined. Is this case, we don't know if it should be defined.

We could use the following rule: when asking for label in language x and receiving label in language mul: the label is not missing. When asking for language X and receiving Y: the label is missing.

Fallback chain. Rather than jumping straight to English, walk the MediaWiki standard language fallback chain (so e.g. a Hindi user might see Sanskrit before English, depending on the wiki's configuration).

When calling the wikidata API to get labels and description, we are enabling the language fallback feature. As far as I understand it is using the standard MediaWiki language fallback system internally.

Message string (placeholder): "Hindi names aren't available yet for some items; showing those in another language."

Using language name inside of a message is tricky. If you can think of an alternative that doesn't include "Hindi" that would be preferred.

Change #1279446 merged by jenkins-bot:

[mediawiki/extensions/ArticleGuidance@master] wbgetentities: use languagefallback=1

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

@SGautam_WMF

Mixed results. A search can return some items with Hindi labels and some without. The message should only appear when at least one item actually falls back, and it should make clear that *some* names aren't available, not all of them.

It is not always obvious if the label is missing for a language. Some items use the lang code "mul" to indicate that a label can be used for any language unless explicitly redefined. Is this case, we don't know if it should be defined.

We could use the following rule: when asking for label in language x and receiving label in language mul: the label is not missing. When asking for language X and receiving Y: the label is missing.

Fallback chain. Rather than jumping straight to English, walk the MediaWiki standard language fallback chain (so e.g. a Hindi user might see Sanskrit before English, depending on the wiki's configuration).

When calling the wikidata API to get labels and description, we are enabling the language fallback feature. As far as I understand it is using the standard MediaWiki language fallback system internally.

Message string (placeholder): "Hindi names aren't available yet for some items; showing those in another language."

Using language name inside of a message is tricky. If you can think of an alternative that doesn't include "Hindi" that would be preferred.

Thanks Stephane, updated the description include message and mockup

SBisson changed the task status from Open to In Progress.May 1 2026, 1:00 PM
SBisson moved this task from Needs Code Review to In-progress on the LPL Hypothesis board.

Change #1286430 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ArticleGuidance@master] Special message when results are shown in other languages

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

Change #1286430 merged by jenkins-bot:

[mediawiki/extensions/ArticleGuidance@master] Special message when results are shown in other languages

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

Working as expected, moving it to product signoff