zeeguu / web

Frontend for the zeeguu web application.
https://www.zeeguu.org
3 stars 5 forks source link

Choose Alternative not removing the actual alternative from the text #424

Closed mircealungu closed 1 week ago

mircealungu commented 1 month ago

I've had this happen in the past, and here it is again: the Choose Alternative exercise is not removing the actual alternative from the context:

image

After show translation I see: image

If i edit the word I see that all makes sense there too: image

merleschoen commented 1 month ago

I think the issue might be due to the findBookmarkInInteractiveText function in the TranslatableText component. We are using case-sensitive comparison for the expression and context, so it wouldn't spot the capitalized "I forvejen".

Unfortunately, I can't get my test environment up and running right now with Tiago's latest implementation, so this is just a sophisticated guess for now. 🫠

tfnribeiro commented 2 weeks ago

I will look into this, that's a good guess Merle.

I have not yet encountered it, so it might be a capitalization due to the beginning of the sentence, but I thought when we were comparing we lowercased the string.

tfnribeiro commented 2 weeks ago

I have investigate this and was able to replicate it by changing the casing in the word.

I can see that the "expression" is stored as "i forvejen" instead of "I forvejen" which then means the context is not matched to be replaced by the empty space "_____".

Here the word is "hver år":

image

I will change the expression from "Hver år om" to "hver år":

image

Now we see the issue:

image

Now, I can only see this happen when I manually set the translation, so I am not sure how this happens to Mircea - do you remember translating it in a particular order? I have tried:

mircealungu commented 2 weeks ago

I don't think it's related to the order in which the two words are clicked.

Could I have edited the "I forvejen" and just lowercased it? What should we do in this case? I guess a bookmark in which the word that is translated can't be found in the context should be considered as invalid?

tfnribeiro commented 2 weeks ago

Yes, I think we can add a check to the form that ensures that the bookmark edit is found in the context, if not then give an error.

Maybe to make it easier for the users, we should just "find replace" as they edit the bookmark? In other words, if I edit the word or expression, then it automatically updates the context?

tfnribeiro commented 1 week ago

Something like this?

image

I think it might be better to let the users know?

mircealungu commented 1 week ago

This is cool!