Page MenuHomePhabricator

MinT for Wiki Readers MVP: Explore languages
Closed, ResolvedPublic8 Estimated Story Points

Description

As part of MinT for Wiki Readers MVP (T359072), this ticket provides support for exploring an overview of the contents available about a topic on the different languages in which it is available.
When a topic is selected at the "Confirm" step or at the "Translation view" using the translation options, users can change the source language. Instead of providing the standard language selector directly for the source language, an intermediary step to "Explore languages" is provided. This step surfaces the table of contents for the different languages in which the article is available. This allows the user to explore the content coverage and find relevant sections to read from other languages. an option to access the standard language selector is still available for those searching for a specific language.

Language explorer.png (1×324 px, 51 KB)

Design details

This step includes the following elements:

  • Header. The "Explore languages" label and an action using the ArrowPrevious icon to return to the previous context where the user came from, which in this case could be the Confirm (T359512) or the Translation view (T359801).
  • Access to all languages. An input with the "All languages for this topic" directs users to the standard language selector with all languages in which the article is available. See the Search input codex component.
  • Introduction. Two elements set the context:
    • Information panel. With the title "Learn more from other languages" and the description "Editors in different languages covered this topic in different ways." provides a glimpse about the multilingual nature of the project to explain why the article on a given topic may have different contents on each language.
      • The label "Languages with the most coverage for <topic>" communicate the list is ordered giving priority to those languages where the use can learn the most from.
  • List of contents per language. A list of items that users can select to change the source language. The selected item will be identified by the selected radio button and the light blue progressive-subtle background.
    • Language name and radio button selector.
    • Number of sections and other community-provided quality indicators such as "Featured" or "Good article". See the InfoChip Codex component
    • Section titles. Only the top level sections are listed.

Criteria for the List of contents per language

We want to surface the languages that provide the most coverage for the topic in order to allow users to easily select them as source languages for the translation. This requires to find a balance between the articles with more information overall and those with more sections (covering a more diverse set of aspects for the topic). The proposed approach is as follows:

  • The list will consider all languages that have one or more content sections (excluding "see also", "references" etc. from the count) ordered by the number of sections.
  • The version with the largest article will be shown at the top of the list with a "Most detailed" indicator (see example below).
  • Given the same number of sections, those with a quality indicator ("Featured", "Good article", etc.) will be shown first.
  • If the source language was set to a language for which the article exists but failing the criteria to be shown on the list (e.g., a language with an article but no sections is set in the url) a selected item will be added at the bottom of the list.

Language explorer - most detailed.png (928×324 px, 45 KB)

Language selection behaviour

  • Selecting an item from the "List of contents per language" will set the source language. The user just needs to go back to the previous context without additional confirmation.
  • When accessing the full language selector though the "Access to all languages", selecting a language there will result into the language being directly selected and the user returning to the previous context (Confirm or the Translation view) with the new source language selected.
  • When the user selects as source the current target language, the languages will swap (i.e., the old source language will become the target one to avoid both source and target having the same value).

Additional considerations

  • The elements on top (comprising the "Header" and the "Access to all languages") are sticky. Scrolling will keep them visible on top.
  • View in Figma

Derived Requirement

Ensure that when a user selects the "Explore languages" option in the "Confirm" or "Translation view" steps, they are able to view a language explorer interface displaying languages sorted by content coverage, select a new source language, and return seamlessly to the previous context with the updated source language.

BDD

gherkin
Feature: Explore Languages Interface for MinT Wiki Readers MVP

Scenario: Access the Explore Languages Interface
  Given the user is at the "Confirm" or "Translation view" step
  When the user selects "Explore languages" from the language options
  Then the "Explore languages" interface should display with languages ordered by content coverage

Scenario: Navigate to Standard Language Selector
  Given the user is in the "Explore languages" interface
  When the user selects the "All languages for this topic" input
  Then the standard language selector should open displaying all available languages for the topic

Scenario: Select a Language in the Explorer Interface
  Given the user is in the "Explore languages" interface with a list of languages sorted by content coverage
  When the user selects a language as the source
  Then the source language should update, and the user should return to the previous context

Scenario: Swap Source and Target Languages
  Given the user has selected a language in "Explore languages" that matches the target language
  When the user confirms the language selection
  Then the source and target languages should swap

Scenario: Sticky Header on Scroll
  Given the user scrolls down in the "Explore languages" interface
  Then the header and "Access to all languages" option should remain visible at the top

Test Result - Beta|Prod

Status: ✅ PASS / ❓Need More Info / ❌ FAIL
Environment: beta/xyzwiki
OS: macOS Sonoma 15.0
Browser: Chrome 130
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Access the Explore Languages Interface

  1. Open the "Confirm" or "Translation view" step within the translation workflow.
  2. Select the "Explore languages" option.
  3. ✅❓❌⬜ AC1: Confirm that the language explorer interface displays, showing languages sorted by content coverage.

Test Case 2: Navigate to Standard Language Selector

  1. In the "Explore languages" interface, select the "All languages for this topic" input.
  2. ✅❓❌⬜ AC2: Confirm that the standard language selector displays with all available languages.

Test Case 3: Select a Language in the Explorer Interface

  1. From the "Explore languages" list, select a language as the source language.
  2. ✅❓❌⬜ AC3: Confirm that the selected source language updates and the user returns to the previous context.

Test Case 4: Swap Source and Target Languages

  1. In the "Explore languages" interface, select the current target language as the source language.
  2. ✅❓❌⬜ AC4: Confirm that the source and target languages swap.

Test Case 5: Sticky Header on Scroll

  1. Scroll down within the "Explore languages" interface.
  2. ✅❓❌⬜ AC5: Confirm that the header and "Access to all languages" input remain visible at the top while scrolling.

QA Results - PROD AutomaticTranslation

Event Timeline

Pginer-WMF triaged this task as Medium priority.Mar 11 2024, 3:42 PM
Pginer-WMF created this task.
Pginer-WMF moved this task from Backlog to Product integration on the MinT board.
ngkountas changed the task status from Open to In Progress.Jun 26 2024, 9:48 AM
ngkountas claimed this task.
santhosh renamed this task from MinT MVP: Explore languages to MinT for Wiki Readers MVP: Explore languages.Jun 27 2024, 8:09 AM

Change #1052116 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] ApiQueryAutomaticTranslationDenseLanguages: Add section-titles param

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

Change #1052117 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] AX: Add qid to mediawikiPage and pageSearchResult models

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

Change #1052118 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] AX useSectionTitleTranslate: Expose "doTranslateSectionTitle" method

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

Change #1052119 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] AX useApi: Add "fetchDenseArticles" method

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

Change #1052120 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] AX: Add "explore languages" page

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

Change #1052116 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] ApiQueryAutomaticTranslationDenseLanguages: Add section-titles param

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

Change #1052117 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] AX: Add qid to mediawikiPage and pageSearchResult models

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

Change #1052118 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] AX useSectionTitleTranslate: Expose "doTranslateSectionTitle" method

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

Change #1052119 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] AX useApi: Add "fetchDenseArticles" method

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

A few things I noticed while testing this:

Noticing this error quite a bit when fetching translations for section titles:

Error while translating section title "Nichtpersönliche Kontakte" SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

At times, when fetching translations for section titles fails, this is how the UI appears:

image.png (590×342 px, 28 KB)

In this case, the German language section heading failed


The heading for the section says: Languages with the most coverage for "{article}" but we load all languages and fetch translated section titles for all of them.

I think it might be worth it to load the translated section titles for the top 10 languages, and for the rest of them just list the languages. This might also help with the number of requests we make to MinT and help reduce the errors encountered when fetching translations for section titles.

We could also think of updating the section label to: Languages sorted by coverage for "{article}"


I think the lazy loading works well and more section titles are loaded as we scroll.

The heading for the section says: Languages with the most coverage for "{article}" but we load all languages and fetch translated section titles for all of them.

I think it might be worth it to load the translated section titles for the top 10 languages, and for the rest of them just list the languages. This might also help with the number of requests we make to MinT and help reduce the errors encountered when fetching translations for section titles.

We could also think of updating the section label to: Languages sorted by coverage for "{article}"

When articles are available in many languages I think it makes sense to show in the list those with most coverage (i.e., those with more sections + the most detailed one). Having a long tail of articles with just 1-2 sections is not very easy to handle in a flat list in any case. So I'd propose to show only the 10 languages* with most coverage makes sense. For the rest, we can just provide one option at the end to access all of them. This will lead to the language selector (same as the "View all languages" option on top) where users can see the list of all languages with better. tools to select them.

Access to all languages.png (1×1 px, 79 KB)

*When showing 10 languages we may want to have a flexible threshold:

  • 10 languages if there are 15 or more in total.
  • All languages if there are less than 15 in total.

In this way we avoid a situation with 11 languages where we show 10 providing the "more" option just for an additional one.

Change #1052120 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] AX: Add "explore languages" page

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

@ngkountas Please review results below, thanks!

Test Result - Prod AutomaticTranslation

Status:❓Need More Info / ❌ FAIL
Environment: Prod AutomaticTranslation
OS: macOS Sonoma 15.0
Browser: Chrome 130
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://ig.m.wikipedia.org/wiki/%E1%BB%8Cp%E1%BB%A5r%E1%BB%A5iche:AutomaticTranslation?page=Year&from=en&to=fr&step=confirm

Test Steps

Test Case 1: Access the Explore Languages Interface

  1. Open the "Confirm" or "Translation view" step within the translation workflow.
  2. Select the "Explore languages" option.
  3. AC1: Confirm that the language explorer interface displays, showing languages sorted by content coverage.

2024-11-07_09-15-00.mp4.gif (1×634 px, 1 MB)

Test Case 2: Navigate to Standard Language Selector

  1. In the "Explore languages" interface, select the "All languages for this topic" input.
  2. AC2: Confirm that the standard language selector displays with all available languages.

2024-11-07_09-16-36.mp4.gif (1×646 px, 599 KB)

Test Case 3: Select a Language in the Explorer Interface

  1. From the "Explore languages" list, select a language as the source language.
  2. AC3: Confirm that the selected source language updates and the user returns to the previous context.

The source language did change but did you want it to automatically return to the "Automatic translation" when you select the radio button of the language or do you want it to scroll to the top and click on the back arrow just to go back as seen in the gif?

2024-11-07_09-41-56.mp4.gif (1×722 px, 1 MB)

Test Case 4: Swap Source and Target Languages

  1. In the "Explore languages" interface, select the current target language as the source language.
  2. AC4: Confirm that the source and target languages swap.

Is the source and target when selecting a language supposed to look different and like that as seen in the gif?

2024-11-07_09-46-02.mp4.gif (1×634 px, 1 MB)

Test Case 5: Sticky Header on Scroll

  1. Scroll down within the "Explore languages" interface.
  2. AC5: Confirm that the header and "Access to all languages" input remain visible at the top while scrolling.

It does not remain at the top while scrolling as seen in the gif

2024-11-07_09-49-25.mp4.gif (1×658 px, 849 KB)

I created some follow-up tickets with the missing aspects:

Regarding the specific cases:

Test Case 3: Select a Language in the Explorer Interface

  1. From the "Explore languages" list, select a language as the source language.
  2. AC3: Confirm that the selected source language updates and the user returns to the previous context.

The source language did change but did you want it to automatically return to the "Automatic translation" when you select the radio button of the language or do you want it to scroll to the top and click on the back arrow just to go back as seen in the gif?

2024-11-07_09-41-56.mp4.gif (1×722 px, 1 MB)

Returning is triggered by the user by tapping the back arrow. Currently the header is not sticky which complicates access to the arrow, which is covered in T381483.

Test Case 4: Swap Source and Target Languages

  1. In the "Explore languages" interface, select the current target language as the source language.
  2. AC4: Confirm that the source and target languages swap.

Is the source and target when selecting a language supposed to look different and like that as seen in the gif?

2024-11-07_09-46-02.mp4.gif (1×634 px, 1 MB)

Swapping works as expected. In your example where we start with Spanish -> Igbo pair, the way to test this is to change the source language to select Igbo instead of Spanish. This would potentially lead to an invalid result (Igbo -> Igbo). So the system does the swap and uses ther previous source as target resulting in Igbo -> Spanish.

Test Case 5: Sticky Header on Scroll

  1. Scroll down within the "Explore languages" interface.
  2. AC5: Confirm that the header and "Access to all languages" input remain visible at the top while scrolling.

It does not remain at the top while scrolling as seen in the gif

2024-11-07_09-49-25.mp4.gif (1×658 px, 849 KB)

This is pending from the spec, covered in T381483.

With this, I think we can close the ticket and ocntinue the work when appropriate in the follow-up tickets.

Thanks for reviewing this @GMikesell-WMF!