jelmervdl / translatelocally-web-ext

TranslateLocally for the Browser is a web-extension that enables client side in-page translations for web browsers.
https://addons.mozilla.org/en-GB/firefox/addon/translatelocally-for-firefox/
Mozilla Public License 2.0
65 stars 3 forks source link

Provide context for selection translation #33

Open jelmervdl opened 2 years ago

jelmervdl commented 2 years ago

When translating a selection (especially short ones) provide the translator with a bit of context (e.g. the full chunk) and use the html translation feature to mark the selection inside that chunk. For presentation, only the translated selection can be shown.

Context size might be a bit tricky: just the entire sentence(s) the selection appears in will suffice. But we don't have a sentence splitter in JavaScript.