Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/utahta/trans.nvim
Google language translator plugin for Neovim
https://github.com/utahta/trans.nvim
google neovim-plugin translate
Last synced: about 2 months ago
JSON representation
Google language translator plugin for Neovim
- Host: GitHub
- URL: https://github.com/utahta/trans.nvim
- Owner: utahta
- License: mit
- Created: 2018-01-30T02:45:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-11T21:02:07.000Z (about 1 year ago)
- Last Synced: 2024-06-20T10:06:42.181Z (7 months ago)
- Topics: google, neovim-plugin, translate
- Language: Go
- Homepage:
- Size: 3.42 MB
- Stars: 22
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# trans.nvim
trans.nvim is a plugin for Neovim to translate text with Google Translator.
### message
![trans_nvim_message](https://user-images.githubusercontent.com/97572/66647837-ed156d80-ec64-11e9-91ce-222b7b529dc8.gif)### preview
![trans_nvim_preview](https://user-images.githubusercontent.com/97572/66647812-da029d80-ec64-11e9-86f9-44414dc89bba.gif)### floating window
![trans_nvim_floating_window](https://user-images.githubusercontent.com/97572/66648107-b12ed800-ec65-11e9-9131-49568c07b619.gif)## Required
You must first set up authentication by creating a API Key or service account of GCP.
Then you need to install the [Go](https://golang.org/dl/) of version 1.11 or more.
### Using API Key
The API Key documentation can be found [here](https://cloud.google.com/translate/docs/auth#using_an_api_key).
Please set the environment variable `TRANS_API_KEY` to the API Key.
### Or Using Service Account
The service account documentation can be found [here](https://cloud.google.com/iam/docs/creating-managing-service-accounts).
Please set the environment variable `GOOGLE_APPLICATION_CREDENTIALS` to the file path of the JSON file that contains your service account key.
## Note
You need a little bit of money to use google translate API.
e.g. it costs $0.06 for 2889 characters.## Installation
For vim-plug
```viml
Plug 'utahta/trans.nvim', {'do': 'make'}
```## Settings
```viml
let g:trans_lang_locale = 'ja'
let g:trans_lang_output = 'preview'
```### To use floating windows
Floating windows are supported in neovim >= 0.4.0.
```viml
let g:trans_lang_output = 'float'
```A Floating window is automatically hide when cursor is moved.