uetchy / Polyglot

🌏 The missing Safari extension that translates selected text into your native language.
Other
482 stars 44 forks source link

Add option to show button to confirm instant translation #94

Closed davidyuk closed 3 years ago

davidyuk commented 3 years ago

I have used Google Translate extension in Chrome before, and I liked the option to show a small button when some text selected for translation confirmation. I miss that feature in this extension and proposing its implementation here.

Currently, I'm using Polyglot in "Instant Translation" mode it works fine except:

As an alternative to this, I have found the context menu option to invoke translation of the selected text. This is close to the feature I'm proposing to implement, but from my perspective, the current feature is a bit more accessible.

I have added one switch in the settings: Screenshot 2021-02-28 at 21 45 50 The designs and wording is quite a draft. Probably would be more reasonable to use a Combobox with values like "Disable Instant Translation"/"Instant Translation with confirmation"/"Instant Translation". But don't want to deal with settings migrations at least at the current step.

The translation confirmation button looks this way: Screenshot 2021-02-28 at 21 46 18 It shows near the cursor. It works well in most cases, except when a long paragraph is selected from the end to the beginning.

uetchy commented 3 years ago

Thank you for the PR, it looks super lit! I will test this patch in my env.

uetchy commented 3 years ago

Testing for a couple of days, I found no major issues on this patch. Again, thank you @davidyuk for giving great addition to Polyglot!

uetchy commented 3 years ago

PSA: This feature has landed on Mac App Store version of Polyglot.