Page MenuHomePhabricator

Provide a more flexible language pair selection in the MinT MVP
Open, MediumPublic

Description

As part of MinT for Wikipedia Readers MVP (T359072), when selecting language pairs for the machine translation in the Home (T359401) or Confirm (T359512) steps the target language is hidden from the list of source languages in the current implementation. This avoids having a language pair with both source and target languages being the same, but it makes it complex for users to change from en → ca to ca → en, for example.

Initial language pair is English to CatalanWhen changing the source language, the target language ("Catalan") is not available
ca.m.wikipedia.org_wiki_Especial_MinT(Wiki Mobile) (1).png (568×320 px, 30 KB)
ca.m.wikipedia.org_wiki_Especial_MinT(Wiki Mobile) (2).png (568×320 px, 15 KB)

This ticket proposes ot follow a similar approach to the one used in Section Translation. Given a language pair a → b, selecting b as source should result in the b → a pair (note that the target language is changed automatically to a to avoid the selection to be b → b which makes no sense). Similarly, given a language pair a → b, changing the target language to a will result in the b → a language pair. This provides users with all options, respects user choice and results in valid pairs.

Special cases to consider

(These can be moved to a separate ticket if supporting them as part of this one becomes too complex)

There are some additional considerations to take into account for the Confirm step. There, the list of source and target languages is different. While the target languages includes all languages supported by MinT, the source languages are those in which the article is available.

This means that there are some additional pairs that cannot be selected due to the following cases:

  • Only-source languages. Source languages that are not available as target. For example, an article may be available in Volapük which is not supported in MinT. Thus, Volapük can be selected as source but not as target.
  • Only-target languages. Target languages that are not available as source. For example, MinT supports languages for which there is no Wikipedia yet such as Bodo. Thus, Bodo can be selected as target but not as source.

When the user selection makes impossible to use the previous source as target (or vice versa), the affected item will become empty (with a "Select" label for the user to select manually). For example, given a pair Volapük → Igbo, selecting Igbo as source will result in Igbo → [select] for the user to choose another target language. Elements to continue (such as the translation card in th eConfirm step or the search input in the Home step) will become disabled until the user selects a valid option.

Only one option
Another particular case is when there is only one option for the source language. For example, an article only available in English. For such case, it makes sense to show the source selector disabled and exclude "English" from the list of target language options.