Page MenuHomePhabricator

property selector fallback is not falling back from language variant to major language
Open, HighPublic8 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:

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

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 22 2021, 2:33 PM

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.)

darthmon_wmde set the point value for this task to 8.Jan 27 2021, 12:59 PM

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

Rosalie_WMDE removed Rosalie_WMDE as the assignee of this task.Mon, Feb 22, 1:56 PM
Rosalie_WMDE added a subscriber: Rosalie_WMDE.

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