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

Replace original text with translation #38

Open
Silex opened this issue Oct 27, 2015 · 4 comments
Open

Replace original text with translation #38

Silex opened this issue Oct 27, 2015 · 4 comments

Comments

@Silex
Copy link

Silex commented Oct 27, 2015

Hello,

How do I:

  • Select a region
  • Call M-x google-translate-at-point and have the translation automatically replace the region
@FrancisMurillo
Copy link

Hello,

It would be nice to provide another option alongside current-buffer to google-translate-output-destination to replace the text as well.

Here is my shiv for this issue:

(defun fn/google-translate-at-point ()
      "Translate at point while replacing the text."
      (interactive)
      (when (region-active-p)
        (let ((beginning (region-beginning))
              (end (region-end))
              (google-translate-output-destination 'current-buffer))
          (google-translate-at-point)
          (kill-region beginning end))))

@Silex
Copy link
Author

Silex commented Apr 10, 2019

@atykhonov: ping

@junpls
Copy link

junpls commented Oct 7, 2019

I would definitely love to have this too!
How I imagine it, you should be able to first select the desired translation by pressing the corresponding number though.

I'm using the popup option because I like it visually, but for very long words it is annoying that the translation disappears as soon as you press a button. A replace function would be very useful.

@stardiviner
Copy link
Collaborator

This is interesting, I have saw similar feature request now. I will consider to add an interactive way to select multiple output targets. Might implement with #79

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

No branches or pull requests

4 participants