Translate selected text into with Google Translate.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Menu: JA → EN | |
// Description: Translate selected text into with Google Translate. | |
// Author: Brandon Pittman | |
// Shortcut: ctrl j | |
import "@johnlindquist/kit"; | |
const origin = "https://translate.google.com"; | |
const text = await getSelectedText(); | |
const sl = "ja"; | |
const tl = "en"; | |
const op = "translate"; | |
const url = encodeURI(`${origin}/?sl=${sl}&tl=${tl}&text=${text}&op=${op}`); | |
exec(`open "${url}"`, { encoding: "utf8" }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment