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
- Host: GitHub
- URL: https://github.com/lordpax/translate
- Owner: LordPax
- Created: 2022-09-25T15:18:22.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-25T14:27:15.000Z (over 2 years ago)
- Last Synced: 2025-03-27T09:05:23.755Z (over 1 year ago)
- Topics: cli, deepl, translation
- Language: Shell
- Homepage:
- Size: 40 KB
- Stars: 16
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```