Tatoeba / tatoeba2

Tatoeba is a platform whose purpose is to create a collaborative and open dataset of sentences and their translations.
https://tatoeba.org
GNU Affero General Public License v3.0
714 stars 132 forks source link

It's possible to add translations in a language that is hidden from view #3055

Open Yorwba opened 1 year ago

Yorwba commented 1 year ago

To Reproduce

  1. Go to your settings.
  2. In the "Languages" field, enter some ISO 639-3 codes to limit which translations will be displayed.
  3. Go to any sentence.
  4. Add a translation with the dropdown set to "Auto detect".
  5. If the language is detected as something that is not in the list from step 2, it will nonetheless show up in the list of translations.
  6. Refresh the page.
  7. The newly-added translation is no longer visible, although it is of course still present in the database.

Expected behavior I think the least surprising outcome would be if at step 5 the server refuses to add the translation and instead returns an error message telling the user to specify the language explicitly.

Another possibility would be to have the translation remain visible at step 7 (i.e. an exception to the functionality of limiting translations to only particular languages, in order to always show the user's own sentences).

Additional information In #1614, it was suggested to set the language to "unknown" if the auto-detected language is not in the user's profile languages, but that wouldn't help here, because "unknown" is of course also not in the user's translation languages. (And it's possible for the profile languages and the translation languages to be different, which doesn't help either.)

danail-georgiev commented 11 months ago

Hi,

@Yorwba , I tried to reproduce the issue on my local environment, it seems the bug is not reproducible there. Is it still an issue because it seems to me this might be resolved. If so we can close the issue here :)

Yorwba commented 11 months ago

On dev.tatoeba.org, step 5 only reproduces when the old design is enabled in the settings. With the new design, the added translation is never shown. Of course that doesn't fix the underlying problem where users accidentally add translations they can't even see...