Closed mircealungu closed 1 week 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. ðŸ«
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.
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":
I will change the expression from "Hver år om" to "hver år":
Now we see the issue:
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:
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?
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?
Something like this?
I think it might be better to let the users know?
This is cool!
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:
After show translation I see:![image](https://github.com/zeeguu/web/assets/464519/9532b99a-a3b7-43a2-a121-a86dfac3cc63)
If i edit the word I see that all makes sense there too:![image](https://github.com/zeeguu/web/assets/464519/acfe97cd-b6aa-448c-94e9-c8b835d42bf8)