Page MenuHomePhabricator

[M] WikibaseMediaInfo does not support editing monolingual text in languages not supported by MediaWiki
Closed, ResolvedPublic

Description

Wikibase supports a number of languages for monolingual text values which are not known to MediaWiki. On MediaInfo entities, monolingual text statements using these languages can be added using the API, but there is no support in the UI. On Wikidata, the monolingual text language selector doesn’t recognize these language codes (T124758), but still accepts them and sends them to the backend (where they’re known); on Commons, on the other hand, if a language (code) isn’t recognized by the UniversalLanguageSelector, there’s no way to even attempt to save the value.

API support tested on Test Commons with the wbsetclaim API, with the following claim payload (based on Finrod Felagund’s birth name):

{
  "mainsnak": {
    "snaktype": "value",
    "property": "P250",
    "datavalue": {
      "value": {
        "text": "Findaráto",
        "language": "qya"
      },
      "type": "monolingualtext"
    },
    "datatype": "monolingualtext"
  },
  "type": "statement",
  "id": "M1052$7313b8df-4548-bfd5-ae2b-979a8ff83cc8",
  "rank": "normal"
}

The resulting statement can be seen at File:Testfile Teufelsbruch.jpg, but can’t be edited – though that might just be because Test Commons is in a broken state in general; it seems to be in fact impossible to add any monolingual text statement at all, regardless of language. But you can see that adding such monolingual text is not supported on real Commons, e. g. File:PNG Test.png.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Terms/captions seem to have a similar problem (not sure if it’s worth a separate task). With the ?uselang parameter, you can force one unsupported language code to appear in the user interface, but you can’t save it:

Screenshot_2020-10-01 File PNG Test png - Wikimedia Commons.png (298×800 px, 29 KB)

MarkTraceur renamed this task from WikibaseMediaInfo does not support editing monolingual text in languages not supported by MediaWiki to [M] WikibaseMediaInfo does not support editing monolingual text in languages not supported by MediaWiki.Nov 18 2020, 5:28 PM

Change 663572 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/WikibaseMediaInfo@master] Add terms/monolingual text support for some languages not known to MW

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

Change 663572 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Add terms/monolingual text support for some languages not known to MW

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

Etonkovidova subscribed.

Checked in commons beta and commons wmf.32.

What was checked:
(1) The qya and srq are listed as available languages in https://commons.wikimedia.org/w/api.php?action=query&format=json&meta=wbcontentlanguages&wbclcontext=monolingualtext&wbclprop=code`
Test cases checked
(2) srq can be added and published (type srq and press Enter) although is not listed in the list of languages.

Screen Shot 2021-03-16 at 2.57.54 PM.png (526×1 px, 49 KB)
Screen Shot 2021-03-16 at 2.58.14 PM.png (252×989 px, 30 KB)

(3) qya is available for properties with monolingual data type only - e.g. https://test.wikidata.org/wiki/Property:P250. If that property is added in Structured data. it's possible to add qya lang and publish:

Screen Shot 2021-03-16 at 3.22.39 PM.png (214×999 px, 23 KB)