This Neovim plugin allows you to translate selected text using Crow Translate (required on your system).
Text will be replaced over the selection.
Using lazy.nvim:
{
"coffebar/crowtranslate.nvim",
lazy = true,
cmd = { "CrowTranslate" },
opts = {
-- Japanese to English if selected text includes Japanese characters
language = "ja",
mask = "[ぁ-んァ-ン一-龥]", -- regex for your language detection
default = "en", -- alternative language
engine = "google", -- google, bing, libretranslate, lingva, yandex
},
},
Select text in visual mode and run :CrowTranslate
. Text will be replaced with the translation.
-- Example keymap with which-key
local wk = require("which-key")
wk.register({
T = { "<cmd>CrowTranslate<cr>", "Translate selected text" },
}, { mode = "x" })
The direction will be automatically detected based on the selected text and the mask
option.
Alternatively, you can specify the direction manually by passing argument to command:
:CrowTranslate en
- Windows is not supported, PRs are welcome.