Skip to content

Context menu support for translate using macOS #1575

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

Open
hardkrash opened this issue Apr 25, 2025 · 1 comment
Open

Context menu support for translate using macOS #1575

hardkrash opened this issue Apr 25, 2025 · 1 comment
Labels
Feature Request New features request. Not an existing issue or bug.
Milestone

Comments

@hardkrash
Copy link

I would like to enable translation of words in the text window using the native Mac translation engine.

Using the built in Mac OS translation requires no third party services and keeps my text on my system

There are various vim translation plugins but they call out to external translation services on the internet.
I prefer to use the offline capable translation in macOS

@ychin ychin added the Feature Request New features request. Not an existing issue or bug. label Apr 26, 2025
@ychin ychin added this to the Backlog milestone Apr 26, 2025
@ychin
Copy link
Member

ychin commented Apr 26, 2025

Interestingly I was just playing around with this recently and got a prototype working:

Image

The big caveat is that the native macOS Translation API (introduced in macOS 15 Sequoia) is, frankly, terrible. It requires SwiftUI (which MacVim does not use) and is kind of a pain to use. The prototype above was instead done using private APIs similar to how native apps like Safari work, but I need to think more about the proper way to integrate this and whether I want to do this (using private APIs is not the end of the world but something I prefer to limit the usage of).

But I agree. Being able to leverage the system built-in translation service is nice. Apple just for some reason made it difficult to properly access it. For example, the new Apple Intelligence Writing Tools "just works" on any user texts and doesn't require much integration at all. I'm not sure why they made this so much more complicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New features request. Not an existing issue or bug.
Projects
None yet
Development

No branches or pull requests

2 participants