LordPax / translate

translate a text with deepl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Translate

Description

Translate text with deepl

Required Dependencies

  • jq
  • curl

Available engine

Installation

  1. Clone the repository:
git clone https://github.com/LordPax/translate.git
cd translate
  1. Execute the script to generate config file in .config/translate
./translate
  1. Create dotenv file ~/.config/translate/config with your needed information like api key
USED_ENGINE=deepl
DEEPL_ROUTE=https://api-free.deepl.com/v2/translate
DEEPL_KEY=mandatory if you use deepl
LIBRE_ROUTE_DETECT=localhost:5000/detect
LIBRE_ROUTE=localhost:5000/translate
LIBRE_KEY=not mandatory if route is on localhost

Usage

Usage : translate <option> [text]

Option :
-h or --help ........................... Show help
-v or --version ........................ Show version
-e or --engine <engine> ................ Set engine (default : deepl)
-s <lang> .............................. Source language
-t <lang> .............................. Target language

Engine :
* deepl
* libre

Example :
translate -t fr "Hello World!"
echo "Hello World!" | translate -t fr

About

translate a text with deepl


Languages

Language:Shell 100.0%