Page MenuHomePhabricator

property selector fallback is not falling back from language variant to major language
Closed, ResolvedPublic8 Estimated Story Points

Description

Problem:
Language fallbacks seem not to be working when using Wikidata in a UI language that is a language variant.

Steps to reproduce:

  1. set UI language to a variant like de-at or en-gb
  2. try to add a new statement
  3. see the property suggester pop up with several suggestions
  4. see many of the suggestions without a label fallback used but instead display the Property ID

Examples:

Screenshots/mockups:

image.png (319×907 px, 27 KB)

Open questions:

  • Is it the language variant or the fact that there is a - in the language code that's the issue?

Requirements for the local dev env
Have property sugester https://www.mediawiki.org/wiki/Extension:PropertySuggester installed

Event Timeline

Specific request observed on the linked example page: https://www.wikidata.org/w/api.php?action=wbsgetsuggestions&search=&context=item&format=json&language=sgs&entity=Q81129700

Response (note the "label"s):

{
  "search": [
    {
      "id": "P2093",
      "url": "//www.wikidata.org/wiki/Property:P2093",
      "rating": "0.6438066303730011",
      "label": "P2093"
    },
    {
      "id": "P50",
      "url": "//www.wikidata.org/wiki/Property:P50",
      "rating": "0.17997128516435623",
      "label": "P50"
    },
    {
      "id": "P921",
      "url": "//www.wikidata.org/wiki/Property:P921",
      "rating": "0.16829805076122284",
      "label": "P921"
    },
    {
      "id": "P2860",
      "url": "//www.wikidata.org/wiki/Property:P2860",
      "rating": "0.14345805644989013",
      "label": "P2860"
    },
    {
      "id": "P932",
      "url": "//www.wikidata.org/wiki/Property:P932",
      "rating": "0.119169320166111",
      "label": "P932"
    },
    {
      "id": "P5875",
      "url": "//www.wikidata.org/wiki/Property:P5875",
      "rating": "0.09124389588832856",
      "label": "P5875"
    }
  ],
  "success": 1,
  "searchinfo": {
    "search": ""
  }
}

(sgs is the standard language code for bat-smg according to LanguageCode::DEPRECATED_LANGUAGE_CODE_MAPPING.)

The same thing happens with uselang=sgs, and sgs falls back to lt, so this seems to happen at least sometimes even without hyphens in any language code involved.

Probably the easiest way to test this is to configure something like

LocalSettings.php
$wgPropertySuggesterInitialSuggestions = [ 6 ];

so that you don’t have to fully set up PropertySuggester (load and process a dump etc.). The initial suggestions are used on empty items. (I used 6 because P1 to P5 don’t exist on my wiki; other wikis could use a different property ID.)

Change 664832 had a related patch set uploaded (by Rosalie Perside (WMDE); owner: Rosalie Perside (WMDE)):
[mediawiki/extensions/PropertySuggester@master] [WIP]property selector fallback is not falling back from language variant to major language

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

Change 666324 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/PropertySuggester@master] Add Wikibase/data-access to phan directory lists

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

Change 666324 merged by jenkins-bot:
[mediawiki/extensions/PropertySuggester@master] Add Wikibase/data-access to phan directory lists

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

Change 664832 merged by jenkins-bot:
[mediawiki/extensions/PropertySuggester@master] Use language fallbacks in suggestion results

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