trans
Google Translate CLI written in Go.
Required
You must first set up authentication by creating a API Key or service account of GCP.
API Key
The API Key documentation can be found here.
Set the environment variable TRANS_API_KEY
to the API Key.
Or Service Account
The service account documentation can be found here.
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
$ go get -u github.com/utahta/trans/cmd/trans
Usage
$ trans -t en こんにちは
Hello
$ trans -t ja this is a pen
これはペンです
$ trans -t ja -r "this is a pen"
これはペンです
this is a pen