Page MenuHomePhabricator

Add option to edit interlanguage links as an option on the language selector empty state
Open, MediumPublic

Description

As a follow-up from T310259 where the option to "edit interlanguage links" was added to the language selector, this ticket is focused on making such option also available from the language selector empty state (T290436).

When pages are not available in other languages, the language selector shows an empty state to communicate that the user cannot navigate to other languages and lists the actions available. For example. looking at unconnected pages, a page like Octomedusa is not listing the "edit interlanguage links".

Proposal

The expected result is to have the "Edit language links" option listed, which should allow to connect equivalent pages in different languages. It can use the same process used in Vector legacy

CurrentExpected
en.wikipedia.org_wiki_Octomedusa(iPad Air).png (820×1 px, 383 KB)
nolangs-options.png (550×472 px, 43 KB)

Technical details

Nik provided some details about the integration:

Adding to Pau's comment above, I checked that the module that registers the “Edit language links” action button is the wikibase.client.vector-2022 module. I checked the loaded modules for the above page (using mw.inspect() inside the Developer’s console) and the module doesn’t seem loaded. This is why the button is not visible. I checked the conditions used to add the module, in the codebase and I believe it's the following condition that prevents the module from being added:

$outputPage->getProperty( 'wikibase_item' ) !== null

The wikibase_item property for this page seems to be undefined. We can easily verify that by using the following API URL: https://en.wikipedia.org/w/api.php?action=query&prop=pageprops&titles=Anniversary_Peak&format=json and check that there is no "wikibase_item" key returned.

So, I think we should also add the wikibase.client.vector-2022 module for pages where wikibase_item property is null.

Event Timeline

Pginer-WMF triaged this task as Medium priority.Feb 13 2023, 8:36 PM
Pginer-WMF created this task.

For context, copying a comment mentioning conversations where the aspects covered in this ticket were noticed as missing in the current experience:

In T329531#8638096, @Zapipedia-WMF wrote:

In case it helps, some users (see the threads here and here) are reporting that, when there is not additional languages related to an article, it should be possible to add interlanguage links also from the Language menu since, in those cases, the menu title is "Add languages".