chinese-words-separator / chinese-words-separator.github.io

5 stars 1 forks source link

English annotation not just in video subtitles, but for all text #26

Closed chinese-words-separator closed 7 months ago

chinese-words-separator commented 7 months ago

From Chrome web store review:

I love that there is not only pinyin but also individual translations under each word. Any chance you can turn it into a feature that would work on any website containing Chinese texts? (at this moment, I only get 1)pinyin for each word (normal), 2) each word colored according to tones (normal)).

If it is already a feature could you please tell me how to properly activate it, so that it provides word-for-word translation not only on youtube videos where the authors have made dedicated Chinese subtitles, but also on any non-video websites with Chinese text?

The current implementation is computationally-intensive, as the English words that will be displayed on video's subtitle is determined dynamically. If the user set 10 letters on "Limit English annotation to __ letters" setting of Hoverless video dictionary, the English annotator will choose an English word from the dictionary that is 10 letters or below, likewise if the user set that to 6 letters only (the average English word length is 4.7 letters), the English annotator will choose an English word from the dictionary that is 6 letters only or below. Hence, English annotation functionality is implemented on video subtitles only, where the English annotation is done one sentence at a time only. Implementing this on all text will cause performance problem when each word of the page is rendered with English annotation

An alternative, the translation of the sentence/phrase can be embedded in the dictionary. The granularity of the translation is by sentence/phrase, not by each word though. Anyway, Chinese is a concise language, for example, "I like it!" is just "我喜欢!" in Chinese, 我 = I, 喜欢 = like. Chinese don't need to express "it" when they are saying "I like it!". You'll have an easier time mapping each Chinese words to English since there are only few words to map between the two languages

Having said that, here are the steps to activate embedded translation in the dictionary:

Double click the loud speaker icon in the dictionary:

image

Re-hover the sentence/phrase, the hovered text is embedded in the dictionary:

image

Then right-click anywhere on the page, then select Translate to English:

image

Result:

image

For best result, make all the definitions glanceable. This can be done by setting the dictionary height to Maximum, and by setting the dictionary to display one line definition only

image

Result:

image