As a develop, we are often asked to change some text in our code base. It gets kind of annoying when there's like different languages to change.
I am lazy, So I made this plugin.
set GOOGLE_APPLICATION_CREDENTIALS
and GOOGLE_API_PROJECT_ID
export GOOGLE_APPLICATION_CREDENTIALS="<your json file path here downloaded from google cloud console>"
export GOOGLE_API_PROJECT_ID="<your project id>"
Example:
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/.local/neovim-api.json"
export GOOGLE_API_PROJECT_ID="neovim-api"
{
'~/projects/google-translate.nvim',
build = { 'pip install -r requirements.txt', ':UpdateRemotePlugins' },
config = function()
require('google-translate').setup()
end,
}
use {
'kiddos/translate.nvim',
run = { 'pip install -r requirements.txt', ':UpdateRemotePlugins' },
config = function()
require('google-translate').setup()
end,
}
add your own language
vim.api.nvim_create_user_command('TranslateJP', function() translate.translate('ja') end, opts)
:TranslateCN
:TranslateTW
:TranslateEN