OiWorld / MindTheWord

An extension for Google Chrome that helps people learn new languages while they browse the web.
43 stars 47 forks source link

Translate one word per sentence #185

Closed ankit-m closed 7 years ago

ankit-m commented 7 years ago

This PR adds functionality to translate one word in each sentence.

onewordps

It is significantly faster than the replaceAll function. Users can create a pattern and toggle the button if they want one word to be translated in each sentence. Clicking on the button again turns it off.

ceilican commented 7 years ago

Thanks! The "One Word per Sentence" feature is great.

However, I think it should be a local option on a per pattern basis. For instance, instead of choosing "translate 60% of all words from English to Portuguese" when creating a pattern, the user could have the option to choose "translate one word per sentence from English to Portuguese".

What do you think?

As it is now, it is unclear to the user that the global option of "one word per sentence" will completely override the translation percentage of all patterns.

In the future, one could also think of more sophisticated combinations, such as "translate one word per sentence of 60% of all sentences..." .

ankit-m commented 7 years ago

@Ceilican Here's what I think the user goes through when he makes a pattern.

  1. I want to create a pattern which will translate 30% of all words in English to French.
  2. When he/she sees a lot of translations in one line, he/she would want to reduce the number of translations per sentence. (Note: The user does not want to reduce the total amount but only the amount per sentence).
  3. He/She would go and click one word per sentence

Also, this is a local feature which applies to the current translation pattern. If you remove that translation or select another, it is automatically deselected.

ceilican commented 7 years ago

Ok. Let's leave it like this for now, because implementing my enhancement suggestion above would require major changes in the code.

ceilican commented 7 years ago

Could you move the "Do Not Translate" button to the right of the "User Defined Only" button?