translatium-legacy
translatium-legacy copied to clipboard
Add translation of selected text by hotkey
Resolve https://github.com/webcatalog/translatium-desktop/issues/18
I added a new function to get and translate selected text in any window and an option to enable or disable this feature.
Thanks a lot for the PR, @sEpt0r. Currently, this is blocked because robotjs
could not be built properly with elecctron
. https://github.com/octalmage/robotjs/issues/675
This command will rebuild the C ++ extensions for the version of electron you are using.
"rebuild": "npm rebuild --runtime=electron --target=12.0.11 --disturl=https://atom.io/download/atom-shell --abi=87",
This command will rebuild the C ++ extensions for the version of electron you are using.
"rebuild": "npm rebuild --runtime=electron --target=12.0.11 --disturl=https://atom.io/download/atom-shell --abi=87",
It wouldn't work in production. I don't know why but webpack
and electron-builder
doesn't recognize robotjs binary as valid.
I will try to find a workaround for this. I also see an error with the dist command.
With this fix, the webpack
can compile the robotjs
dependency and build the app. For MacOS, Accessibility permissions are required to retrieve selected text from other applications.
Also, consider splitting the settings for translating selected text and text from the clipboard, as I pushed in the initial PR. In my case, I always have something in the clipboard and want to open an empty translation window without translating the clipboard using hotkeys if nothing is selected.