An open API service indexing awesome lists of open source software.

https://github.com/lordpax/translate

translate a text with deepl
https://github.com/lordpax/translate

cli deepl translation

Last synced: about 1 year ago
JSON representation

translate a text with deepl

Awesome Lists containing this project

README

          

# Translate

## Description

Translate text with deepl

## Required Dependencies

- `jq`
- `curl`

## Available engine

- [deepl](https://www.deepl.com)
- [libre](https://github.com/LibreTranslate/LibreTranslate)
- [google](https://cloud.google.com/translate) (not implemented yet)

## Installation

1. Clone the repository:

```bash
git clone https://github.com/LordPax/translate.git
cd translate
```

2. Execute the script to generate config file in `.config/translate`

```bash
./translate
```

3. Create dotenv file `~/.config/translate/config` with your needed information like api key

```bash
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 [text]

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

Engine :
* deepl
* libre

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