Skip to content
/ trl Public

Translate efficiently on the command line using DeepL

License

Notifications You must be signed in to change notification settings

lmerz1/trl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

trl

Translate efficiently on the command line using DeepL:

Rudimentary (!) first version of a shortcut to using DeepL's API in a shell. If you use this for your day-to-day, human-not-machine translation desires, no major issues should occur with the API requests.

Providing your own API key by signing up for free with DeepL is necessary for this to function.

Once you have your own API key, please enter it into the API_KEY.txt file in the following format:

deepl_auth_key your-api-key-here:fx

Valid uses – examples

Both the target language (-t) and the content of the string to be translated (-c) must be specified.

trl -h
trl -t ES -c "Hallo Welt! Wie geht's?"
trl -c "How does Hungarian work again..." -t "hu"

Example output:

~ % trl -c "Can my terminal display a Japanese script?" -t ja
端末に日本語を表示できますか? 
~ % 

and with -f:

~ % trl -c "How does Hungarian work again? I forgot..." -t HU -f

    Request:
    Target language: HU
    >>> 'How does Hungarian work again? I forgot...'

    Answer:
    Detected source language: EN
    >>> 'Hogy is működik a magyar? Elfelejtettem...'

~ %

Dependencies

Currently using jq for processing the response JSON

Further info

For more detailed documentation, check out DeepL's API as well as the list of ISO 639-1 language codes which are used for abbreviating the target language.

Not affiliated in any way with DeepL SE, but appreciative of their free API.

About

Translate efficiently on the command line using DeepL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages