ufal / charles-translator-web-frontend

Charles Translator: MT from Charles University
6 stars 7 forks source link

swapping languages does not update the source field #15

Open jindrahelcl opened 2 years ago

jindrahelcl commented 2 years ago

swapping languages should also swap the content of the input fields. Now, only the target field is updated and the source remains the same.

EbrithilNogare commented 2 years ago

Tohle issue, uz jsem resil a nekdo to zase dal do puvodniho stavu. Fungovalo to tak, ze pri zmene jazyka se ponechal text v leve casti jaky byl a vytvoril se k nemu novy preklad v casti prave. Ackoliv to ma Google tak, ze se prohodi i texty, tak jsem se s nekolika lidmi dohodl, ze takhle je to praktictejsi, nebot pri testovani bylo zjisteno, ze lide nejdrive zadaji ceske vety a pak teprve zjisti, ze prekladac preklada z ukrajinstiny, tudiz musi zmenit smer prekladu a ponechat to co tam napsaly.

martinpopel commented 2 years ago

OK, there are three use cases:

  1. Users who forgot to switch the translation direction before starting to type the input text. These need the current behavior (the source text is kept.)
  2. Users who want to see the "back-translation" of what they've just translated, possibly editing/deleting some parts of the text and checking the effect. These would appreciate what @jindrahelcl suggested (switching the source and target texts, while making sure it is the newest translation).
  3. Users who want to start a new translation in the opposite direction (e.g. in a dialog with a single shared device). These would appreciate deleting the source text (although, we now have the delete button there, so it is just one more click).

Maybe after solving #29 and especially #25, we can minimize the need for the first use case and implement the switching for the second use case. The first use-case users could alternatively use the history feature, but they probably won't get this idea (most probably they see the application for the first time, otherwise they would set the direction correctly) and it seems the last input before language switch is not stored in the history.

So I am OK with keeping the current behavior for now and close this issue if others agree.

martinpopel commented 2 years ago

In the end, I would prefer to switch the texts when the switch button is used. I've heard from other users who prefer this (maybe influenced by all the other online translators which switch the texts). It will be in accordance with the Android app (see ufal/lindat-translation-android#3). In addition, we should allow to choose the language direction by clicking on the source/target language name. While supporting Czech and Ukrainian only, this feature is not the top priority, but we will need in future, when adding more languages, anyway. When changing the source language this way, the source text should stay.