Skip to content

Changes in Translation Functions

Chirag Vashist requested to merge SerChirag/MindTheWord:deep into master

1. Added Chinese Language to "Translate One Word Per Sentence"

2. Made Replacement Changes in "Translate One Word Per Sentence" Previously, the function was changing the first occurence of the word in the sentence. In a sentence like "Original in the world", if "in" is to be replaced, the "in" in "Original" will be replaced.

Before the Change : fault

After the Change: correct

3. Changed deepHTMLReplacement with translateDeep :

Problems with deepHTMLReplacement :

  1. It was too slow. Took around 40 seconds to render translations for large pages due to recursive calls. During this time, the page was unresponsive. New function takes a lot less time.

  2. Non-Uniform Distribution of words. Before the change, all translations were concentrated towards the end of the page. This may give the user the impression that the extension is not working. old_start old_end

In the new function, each paragraph gets an equal distribution of words.

Merge request reports