Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using shortcut to translate #3

Open
GrgMdmn opened this issue Oct 1, 2023 · 10 comments
Open

Using shortcut to translate #3

GrgMdmn opened this issue Oct 1, 2023 · 10 comments

Comments

@GrgMdmn
Copy link

GrgMdmn commented Oct 1, 2023

Hi ! I woud like to know if DeepQT is conceived for translating with a keyboard shortcut as it is on deepl windows app (ctrl + C + C --> translation appears on a Deepl window)

Thanks a lot for answering :)

@VoxelCubes
Copy link
Owner

You can do that all on your own by creating a custom hotkey to open deepqt (using whatever means you like). Since deepqt doesn't support direct translation of clipboard contents, there isn't any further integration I could meaningfully provide.

The closest I think I could manage would be to add a launch option telling deepqt to grab whatever file paths are on the clipboard and immediately translate them. So the workflow being:

  • Look for a file in your file browser
  • Select the file and copy it to clipboard (this stores the file path in your clipboard)
  • press whatever hotkey your have configured to execute deepqt --from-clipboard
  • deepqt immediately opens with that file in the table and starts translating.

Does that sound useful to you? If so, I can see if adding the launch option is feasible. I'll be working on a minor deepqt overhaul once I release the gui for PanelCleaner, whoch has some extra quality of life features (like a theme switcher, if you don't have Qt theming set up on your system already).

@GrgMdmn
Copy link
Author

GrgMdmn commented Oct 2, 2023

Thank you for your answer. I think that solution could work but is less practical than just being able to support clipboard content. In my day use, I practically only use deepl shortcut to translate a sentence or a paragraph, rarely to translate files.

@VoxelCubes
Copy link
Owner

I'm not sure I understand then, do you want DeepQt to offer the same features that the official deepl app does? Because in that case, what's wrong with the deepl app that you're already using? DeepQt uses the same deepl api to translate, so the quality will be no different, unless you want to make use of the DeepQt glossaries in a way that the official glossary system does not allow.

@GrgMdmn
Copy link
Author

GrgMdmn commented Oct 6, 2023

The problem is that I am using Linux, so deepl app does not exist for Linux 😅

@VoxelCubes
Copy link
Owner

Oh, that's cool. In your previous comment you said you used it all the time, so I figured you had it working.

Unfortunately that's kinda out of scope for my project, but I did find projects that provide essentially the same.

There is https://github.com/Freed-Wu/translate-shell as the backend and, if you're on Plasma, you can use this gui as the front end: https://store.kde.org/p/1395666
It looks just like the deepl app. Hope that works for you :)

@GrgMdmn
Copy link
Author

GrgMdmn commented Oct 9, 2023

Thank you sir, I will try this and keep you updated :)

@VoxelCubes
Copy link
Owner

VoxelCubes commented May 26, 2024

Hey, I'm still in the middle of working on a massive overhaul of deepqt, but part of that will be this interactive mode that's like the deepl app. So when that's all done (which is still a few months off) I'll actually be able to fulfill your request...should you still be interested and not already perfectly happy with a different solution :)
The main goal of the refactor though is to support many more APIs, including local models.

@GrgMdmn
Copy link
Author

GrgMdmn commented May 26, 2024

Hi! Of course, I am interested! I did not find any solution that suits me. The biggest problem is that the other solutions are not Wayland compatible so all the proposed shortcuts are not working and the devs are not wanting to move from x11 to Wayland

@VoxelCubes
Copy link
Owner

Well, luckily for you I'm on Wayland so I'll be sure to find a solution. But I think the issue has to do with the security model, where apps can't listen for keybinds unless they are in focus. I think KDE has a solution for this with their global hotkey portal or something, haven't looked into it much. Although, that depends on how you'd want deepqt to behave when pressing the shortcut while it's already open. It'd be easiest to spawn a new window for the new clipboard content, but that does seem very silly, so it should instead intercept that and update the input on the current instance of deepqt.

I'll be working on this, but with how busy this semester is it'll take a long time.

@GrgMdmn
Copy link
Author

GrgMdmn commented May 26, 2024

No problem, I will be patient. And thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants