Page MenuHomePhabricator

Empty states for the responsive language selector
Closed, ResolvedPublic8 Estimated Story Points

Assigned To
Authored By
Pginer-WMF
Oct 15 2020, 10:35 AM
Referenced Files
F74734705: image.png
Apr 1 2026, 5:49 PM
F74734600: image.png
Apr 1 2026, 5:49 PM
F74733357: image.png
Apr 1 2026, 5:49 PM
F74733319: image.png
Apr 1 2026, 5:49 PM
F73562771: image.png
Mar 24 2026, 1:30 PM
F72891226: Translation settings entrypoint
Mar 24 2026, 1:30 PM
F32385569: Empty states - Layout spacing.png
Oct 15 2020, 11:17 AM
F32385526: unavailable.png
Oct 15 2020, 10:35 AM

Description

The language selector (T253303) may show no language options initially or when searching. In some cases it may be possible to provide options for the user about what to do next. This ticket defines a system to support the different empty states for the language selector.

The general structure for the empty states is:

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

The specific cases to support are illustrated below,

No language options

When the list of languages is empty because no options are available at all, the empty state is shown:

zero.png (348×310 px, 12 KB)

No languages yet

No languages are available for now.

Additional actions

The app using the selector can define actions to support users to add the missing languages. For example, on Wikipedia those could lead to Content Translation. In this case, the specific app would customize the description and the list of actions.

Although other actions should be possible, we want to make sure that the example of Content Translation integration works.
In this case, the actions would link to Content Translation with the article pre-selected to start the translation. Two specific target languages are provided based on suggested languages (excluding the current language which is used as source). A generic "more" action is provided where the target language will be selected by the user.

zero-invite.png (348×310 px, 17 KB)

No languages yet

You can translate this page. It’s an easy way to create content in your language.
[Language 1] [Language 2] [More]

Searching a language that does not exist

When the user searches for a language that does not exist in our database of all languages, the empty state is shown. In this case, the user is encouraged to review the spelling and informed of alternative ways to search for the language.

inexistent.png (348×310 px, 15 KB)

Language not recognized
Please, check the spelling. You can search languages by name or ISO code.

Searching a language that exists but is not supported

Often the languages shown by the selector in a given context don't cover all possible languages. For example, users selecting the language version of a Wikipedia article will be provided only the languages for which the article is available. In these cases it is possible for the user to search for a valid language that is not available. The empty state shown is intended to confirm that the language that the user searched for was understood by the system but it was not available.

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

Language not available
The language you are looking for is not available.

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 actions

The app using the selector can define actions to support users to add the missing languages. In this case, the languages surfaced would be those matching the user search. Additional suggested languages can be used to fill the remaining actions.

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

Language not available
You can translate this page. It’s an easy way to create content in your language.

Additional design details

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

See also: T399442: In Vector-2022, the "Add interlanguage links" button should be moved from the toolbox to the "Add languages" button

Event Timeline

Change 635505 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] POC: Renderless language selector and custom selectos based on it

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

Change 635505 abandoned by Santhosh:
[mediawiki/extensions/ContentTranslation@master] POC: Renderless language selector and custom selectos based on it

Reason:
It was just POC

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

abi_ set the point value for this task to 4.
abi_ moved this task from Backlog to In progress on the LPL Projects (ULS rewrite) board.

Change #1243117 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/UniversalLanguageSelector@master] ULS rewrite: Handle empty language states

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

Change #1243145 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/core@master] Expose a variable to track search query hits

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

Test wiki created on Patch demo by APatro (WMF) using patch(es) linked to this task:
https://b1b9984c26.catalyst.wmcloud.org/w/

Change #1243145 merged by jenkins-bot:

[mediawiki/core@master] Expose a variable to track search query hits

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

Change #1248556 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/UniversalLanguageSelector@master] ULS rewrite: Add entrypoints for empty language selector

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

@Pginer-WMF The description in https://phabricator.wikimedia.org/T253303 says,

Searching should not change the dialog width. If a wide three-column version of the dialog is shown based on the large number of languages shown initially, searching should not result in the dialog to become narrow despite reducing the number of languages displayed. This avoids unnecessary distraction (as described in T286514).

What if while searching the results are empty? Should the dialog width be the same? See: https://phabricator.wikimedia.org/T265585 -- In case of no languages option, Searching a language that does not exist, or Searching a language that does not exist the dialog may remain in a single column width which can be a bit narrow to show entry points, is that acceptable?

Change #1243117 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@master] ULS rewrite: Handle empty language states

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

@Pginer-WMF The description in https://phabricator.wikimedia.org/T253303 says,

Searching should not change the dialog width. If a wide three-column version of the dialog is shown based on the large number of languages shown initially, searching should not result in the dialog to become narrow despite reducing the number of languages displayed. This avoids unnecessary distraction (as described in T286514).

What if while searching the results are empty? Should the dialog width be the same? See: https://phabricator.wikimedia.org/T265585 -- In case of no languages option, Searching a language that does not exist, or Searching a language that does not exist the dialog may remain in a single column width which can be a bit narrow to show entry points, is that acceptable?

I'd consider keeping the width as a starting point. If we see that this affects too negatively the experience of entry points (which probably should not, if we have them ready to work on mobile where the space is limited) we can look for alternatives.

Change #1250641 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] Add empty-list ULS entrypoint to translation settings

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

Nikerabbit changed the task status from Open to In Progress.Mar 16 2026, 8:14 AM

Change #1251511 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/UniversalLanguageSelector@master] ULS rewrite: Add entrypoints for empty search selector

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

Change #1248556 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@master] ULS rewrite: Add entrypoints for empty language selector

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

Change #1251511 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@master] ULS rewrite: Add entrypoints for empty search selector

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

Change #1251109 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] Add empty-search ULS entrypoint to invite user for translation

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

abi_ changed the point value for this task from 4 to 8.Mar 24 2026, 1:30 PM

Work for two entry-points is also being handled as part of this task:

  1. empty-search - When the user searches for a language that is valid, but does not yet have a translation.
  2. empty-list - When the language selector is empty especially if there are no translations for a content.

These two entrypoints are then being implemented in the Translate extension to:

Translation settings entrypoint (1,732×982 px, 152 KB)

  • empty-search: When a language is missing on search, show the user an entrypoint to translate that language.

image.png (548×336 px, 18 KB)

Change #1250641 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Add empty-list ULS entrypoint to translation settings

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

Change #1251109 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Add empty-search ULS entrypoint to invite user for translation

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

Test wiki on Patch demo by APatro (WMF) using patch(es) linked to this task was deleted:

https://b1b9984c26.catalyst.wmcloud.org/w/

Testing this on French Wikipedia:

https://fr.wikipedia.org/wiki/Saison_1_de_True_Detective

image.png (535×249 px, 29 KB)

image.png (469×263 px, 27 KB)

https://meta.wikimedia.org/wiki/Meta:Event_organizers

image.png (468×286 px, 19 KB)

https://meta.wikimedia.org/wiki/Event_Center/Registration/Instructions#Email_participants

image.png (467×366 px, 31 KB)

Testing the empty-list entry-point is bit more difficult. When a page is marked for translation, it already has a single language in the language selector.