Fevol / obsidian-translate

Translate text and entire notes in Obsidian
MIT License
103 stars 6 forks source link

Reduce characters sent to translation service #13

Open Fevol opened 2 years ago

Fevol commented 2 years ago

Currently, the entire input gets sent to the selected translation service. If multiple translations are executed on a block of text (say, when the user is typing in the Translation View and they wish to check if their intermediate result is correct), the amount of characters sent to the service will grow exponentially - even more so if the user has auto translate enabled.

The solution for this problem is to only translate the new text. Below are some approaches that could be taken:

Caching

Cache translation results of the service

Issues

Only changes

Only translate parts of the entered text that were changed

Issues