Page MenuHomePhabricator

Add support for empty states to the current language selector
Closed, ResolvedPublic

Assigned To
Authored By
Pginer-WMF
Sep 6 2021, 2:32 PM
Referenced Files
F35528173: fr.wikipedia.org_wiki_Julian_Huxley.png
Sep 22 2022, 10:45 AM
F35528169: en.wikipedia.org_wiki_Rossett_School.png
Sep 22 2022, 10:45 AM
F35511530: Screen Shot 2022-09-06 at 11.06.33 PM.png
Sep 7 2022, 4:40 AM
F35511521: Screen Shot 2022-09-06 at 11.06.05 PM.png
Sep 7 2022, 4:40 AM
Restricted File
Jun 21 2022, 9:28 AM
F34648630: no-langs-settings.png
Sep 20 2021, 1:10 PM
F34648632: nolangs-nooptions.png
Sep 20 2021, 1:10 PM
F34648628: nolangs-options.png
Sep 20 2021, 1:10 PM
Tokens
"Like" token, awarded by Jdlrobson.

Description

With recent desktop improvements the language selector is provided in a new place,. The language selector will become the main entry point for activities (T289840) such as translation, language settings, and connecting interlanguage links in Wikidata.

This ticket proposes to improve the empty states of the current selector in order to (a) support the case where the content is not available in other languages (users may still need to access the selector to translate it or connect it to another article in Wikidata), and (b) surface options to translate where the user searches for a missing language (similar to the mobile update in T286645).

Currently when searching for a language not available, this is the current empty state:

Screenshot 2021-09-06 at 15.54.07 2.png (400×636 px, 48 KB)

The proposed empty states will use the following structure:

  • Title
  • Description
  • (Optional) Actions represented by an icon and (optionally) a label. Up to three actions are shown.

The proposed empty states are described below for both cases mentioned.

No initial languages

When the list of languages is empty because no options are available at all, the empty state is used with additional language options listed below (if available). Options will be different depending on whether options to add languages to the list are available (i.e., translate with Content Translation or edit Wikidata links) which can be different in different wikis (i.e., on Wikipedias vs. other projects):

Options to add languages availableOnly language settings availableNo options available
nolangs-options.png (550×472 px, 43 KB)
no-langs-settings.png (550×472 px, 36 KB)
nolangs-nooptions.png (550×472 px, 34 KB)

(Related ticket: T275147: Empty state for language button and menu)

Searching a language that does not exist or content is not available

Due to technical complexities (T290436#8258761) this part was not implemented and will be supported only in the new version of the language selector (T287860)

When the user searches for a language that does not exist or the content is not available, an empty state will be shown. For the cases where Content translation can be used, options to translate will be surfaced.

Language not available with option to translateLanguage not available (without option to translate) or not existing
unavailable-invite.png (310×348 px, 16 KB)
unavailable.png (310×348 px, 12 KB)

Note that the user search query can result in multiple unavailable languages (e.g., searching for "esp" could lead to this empty state if content is not available for both "español" and "esperanto"), so the generic version of the message does not mention a specific language. For cases where the search query identifies only one language, the title message would include it (e.g., " Esperanto not available").

Additional design details

Empty states - Layout spacing.png (768×1 px, 45 KB)

QA Notes

Note that for the "No initial languages" empty state, the implementation won't match the representation of the mockups:

  • The option to "Edit links" will not appear until it is added on the Wikidata extension, which is supported on a separate ticket (T310259)
  • The test for the first case ("Options to add languages available") will be different as per T290436#8036460 :

No languages yet. Add a new one?
Make the content available in more languages.


These designs are based on the equivalent ticket for the new language selector (T265585)

Event Timeline

Change 807073 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/skins/Vector@master] Show ULS button when article exist only in single language

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

In https://gerrit.wikimedia.org/r/807073, Vector skin is modified to show the language button even if article has only one language.
{F35259030 size=full}

Now we need to change the ULS to respond to that state with the design outlined in this ticket.

@Pginer-WMF In the empty state we should avoid the entrypoint we injected from CX right? - the top "Missing in x, y and more" entrypoint?

@Pginer-WMF In this design, the message " You can translate this page, or connect..." depends on whether we have CX/SX entry point or wikidata entrypoint. But ULS will now know about these entrypoints. ULS does not add them. The extensions like CX or wikidata inject these entrypoints based on defined in conditions in them. This is how the action items is registered. So constructing this message at the side of ULS is not easy. May be translate entypoint is present, but not wikidata. or vice-verse.

Is there a generic message we can provide without tightly coupled with the entrypoints that are added by other extensions? If required we can make sure the entrypoints from CX or wikidata also provide a brief message on what it does. Example: {label: "Translate this page" , description: "You can translate this page to another language with the help of translation tool"}

nolangs-options.png (550×472 px, 43 KB)

Change 807929 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/UniversalLanguageSelector@master] Add support for empty states to the current language selector

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

Is there a generic message we can provide without tightly coupled with the entrypoints that are added by other extensions? If required we can make sure the entrypoints from CX or wikidata also provide a brief message on what it does. Example: {label: "Translate this page" , description: "You can translate this page to another language with the help of translation tool"}

Thanks for surfacing this. I can see the complexity that extensibility brings here.
I think wha we can assume is that extensions will provide ways to expand the list of languages. So for this case we can consider:

No languages yet. Add a new one?
Make the content available in more languages.

This is a bit more encouraging than the default message used when no additional options are available (No languages yet. No languages are available for now.) while still being general enough to cover the cases of Wikidata linking, translation or other future mechanisms of contribution for the list of languages.

Is this a more feasible approach?

@Pginer-WMF In the empty state we should avoid the entrypoint we injected from CX right? - the top "Missing in x, y and more" entrypoint?

Yes. I think we can skip it to avoid multiple messages that overlap conceptually. Here we already mentioned that the page is missing in all (other) languages.

Change 809917 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] relevantlanguages entrypoint: Hide if no languages

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

Change 809917 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] relevantlanguages entrypoint: Hide if no languages

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

Change 807929 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@master] Add support for empty states to the current language selector

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

Change 807073 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Show ULS button when article exist only in single language

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

using the article https://en.wikipedia.org/wiki/Ndowa_Lale as stated the "Edit Language Links" is not available

Also there is a search message highlighted below in the image

Screen Shot 2022-09-06 at 11.06.05 PM.png (510×1 px, 147 KB)

In another article : https://en.wikipedia.org/wiki/Ndawa the search message is missing as shown in the image below:

Screen Shot 2022-09-06 at 11.06.33 PM.png (576×1 px, 201 KB)

@santhosh are they both expected in different situations ? and if so what situations are they ?

using the article https://en.wikipedia.org/wiki/Ndowa_Lale as stated the "Edit Language Links" is not available

The actions in the selector when "Add languages" are shown are plugins. Meaning, they comes from various extensions. Wikidata is yet to add the "Edit Language Links", so it is not available yet. It is tracked in T310259

Also there is a search message highlighted below in the image

Screen Shot 2022-09-06 at 11.06.05 PM.png (510×1 px, 147 KB)

In another article : https://en.wikipedia.org/wiki/Ndawa the search message is missing as shown in the image below:

Screen Shot 2022-09-06 at 11.06.33 PM.png (576×1 px, 201 KB)

@santhosh are they both expected in different situations ? and if so what situations are they ?

The search message at bottom appears after a search. User type something in search box. Till that happens that message is not shown

@santhosh thanks for the clairification, I see the message now and it makes sense.

I will move this to done

The ticket has two parts:

No initial languages
This section seems to be complete with a ticket proposed for covering special cases: T316559: Communicate when pages are not supported in other languages in the current language selector

en.wikipedia.org_wiki_Rossett_School.png (715×1 px, 236 KB)

Searching a language that does not exist or content is not available
This part does not seem to be supported yet:

fr.wikipedia.org_wiki_Julian_Huxley.png (658×1 px, 240 KB)

@Pginer-WMF, I have a question related to the case "Searching a language that does not exist"

As per the ticket , we need to customize the no-language experience like this:

unavailable-invite.png (310×348 px, 16 KB)
unavailable.png (310×348 px, 12 KB)

And the current behavior is as follows

fr.wikipedia.org_wiki_Julian_Huxley.png (658×1 px, 240 KB)

In this design, we are showing a few links under the title "You may be interested in". These are helping readers to read the article in languages that the reader may be interested in(We have a system of logic to calculate this). With the new design, we will replace this support for readers with the invitiation for edits. Are you sure about this? Should we remove the 'You may be interested in" section? What about the footer that shows help about searching?

Technical note after a quick exploration: Implementing custom "no-results-for-search" screen is tricky. jQueyr.ULS accepts an option to pass a function that builds this screen. But that option is already used by mediawiki ULS customization. Overriding that option by another mediawiki extension(CX) is not possible right now. Unless we make MW ULS aware that other MW extensions can customize it - That is too much fragility we are introducing. The behavior will depend which extension registers the "no-results-for-search" first.

@Pginer-WMF, do you think leaving it as current behavior and not adding this complexity is an acceptable trade off?

I can also think of some other solution - which is definitely hacky - Render the expected screen always, but hidden. Then use a CSS selector to hide it or show it based on the ULS dialog has a class uls-no-results

In general it is high time that we rethink about entrypoint mechanism and next gen ULS that can accommodate these needs without getting into this hacks

@Pginer-WMF, do you think leaving it as current behavior and not adding this complexity is an acceptable trade off?

Thanks for all the context, Santhosh. Given the technical complexity, I think we can skip that part for now and consider it for the new version of the selector.

Based on the preliminary entry point results (T295757#8256279): on mobile 16% of users were reaching the tool through this empty state after they searched for their language. One simple way to provide some support for this case on desktop is to leave the "Missing in X, Y, and more" visible in this case (as it is the current state). Even if we remove this invite when searching (which was not intended to be seen in such context) it may be good to keep it for the empty state.

Pginer-WMF updated the task description. (Show Details)

After updating the pending part in the description, the remaining is completed. Thanks everyone!