Page MenuHomePhabricator

Language in Wikidata termbox shows native language names (samples: es-419, sms, nod) or language code (samples: srq, en-us) instead of localised names for some languages
Open, Needs TriagePublicBUG REPORT

Description

Language column in Wikidata termbox shows dagbanli” with a lowercase "d" instead of “Dagbanli with an uppercase "D".

For users who have dag-N in their Babel user information, it appears as “Dagbani with an uppercase "D", as in the second image.

Capture2.JPG (1×2 px, 314 KB)
Capture3.JPG (1×2 px, 312 KB)

Link to discussion on Wikidata:Contact_the_development_team#Fix_typo_request


  • "fkv": name in English remains native name in termbox despite the English name being shown with monolingual text

Note T286031 for some termbox samples:

Both display correctly on monolingual text values


Some from InitialiseSettings.php

  • sms, nod: native name
  • srq: language code

Note the explanation about the current dependencies: T261851#6461737

Event Timeline

@Pablo-WMDE and I looked at it and here is what we found so far:

The wikibase client side code to render the "termbox v1" aka entitytermsview uses wb.getLanguageNameByCode() which in turn

  1. refers to ULS' $.fn.uls.defaults.languages
  2. alternatively falls back to the ULS autonym of the language from $.uls.data.languages
  3. alternatively falls back to the language code

We seem to witness #2 as #1 does not find a result (one can try $.fn.uls.defaults.languages.dag in the browser). I did not research much further what the difference is between $.fn.uls.defaults.languages & $.uls.data.languages and if we are (still?) using them correctly and if they are (still?) doing what they are supposed to do or what their individual expected results are. Given how wikibase' code currently reaches into ULS it would not be surprising if it is using ULS internals which are not considered part of its public API and the usage of which, as a consequence, is prone for breakages and/or does not automatically benefit from improvements/fixes had inside of ULS - I think it would be good to look into this integration in general once more (should be fairly contained) and tend to some of the concerns which existed from day 1 in the process.

FWIW while $.fn.uls.defaults.languages initially gets created from $.uls.data.getAutonyms() (so it contains "dag", albeit as "dagbanli"), UniversalLanguageSelector seems to "extend" $.fn.uls.defaults (incl the languages key) by mw.config.get( 'wgULSLanguages' ) (which does not contain "dag"), so it does not only not add a translation for "dag" in user language but actually strips "dag" as an option. It is only because of the fallbacks in wikibase code that "dagbanli" (by referring to $.uls.data.languages directly) can be displayed at all. WikibaseContentLanguages does not seem to come into play when shaping the value of mw.config.get( 'wgULSLanguages' ).

Language name is correct in CLDR (in LocalNamesEn.php).

Nikki added a subscriber: Nikki.

The underlying problem (as discussed in the comments) is still there, e.g. Lydia mentioned that it was reproducible for fkv and https://www.wikidata.org/wiki/Q483885 still doesn't show the English name for the fkv label.

If this is for another issue that should be solved, then the description should be updated and/or a new parent task created.

Nikki renamed this task from Language in Wikidata termbox shows "dagbanli” instead of “Dagbanli to Language in Wikidata termbox shows native language names instead of localised names for some languages.Jul 2 2021, 11:59 AM
Esc3300 closed this task as Resolved.EditedJul 19 2021, 10:13 AM
Esc3300 claimed this task.

Note T286031 for some termbox samples:

  • "es-419": name in English remains native name despite being defined in CldrNamesEn.php
  • "en-us": name in German remains language code despite being defined in LocalNamesDe.php

Both display correctly on monolingual text values

Esc3300 removed Esc3300 as the assignee of this task.
Esc3300 renamed this task from Language in Wikidata termbox shows native language names instead of localised names for some languages to Language in Wikidata termbox shows native language names or language code instead of localised names for some languages.Jul 19 2021, 10:25 AM
Esc3300 updated the task description. (Show Details)
Esc3300 updated the task description. (Show Details)
Esc3300 renamed this task from Language in Wikidata termbox shows native language names or language code instead of localised names for some languages to Language in Wikidata termbox shows native language names or language code instead of localised names for some languages (samples: fkv, en-us, es-419).Jul 19 2021, 11:20 AM
Esc3300 updated the task description. (Show Details)
Esc3300 renamed this task from Language in Wikidata termbox shows native language names or language code instead of localised names for some languages (samples: fkv, en-us, es-419) to Language in Wikidata termbox shows native language names (samples: es-419, sms, nod) or language code (samples: srq, en-us) instead of localised names for some languages.Jul 19 2021, 11:43 AM
Esc3300 updated the task description. (Show Details)
Esc3300 changed the subtype of this task from "Task" to "Bug Report".Jul 20 2021, 8:13 AM