dptran 1.0.2

A tool to run DeepL translations on command line written by Rust.
dptran-1.0.2 is not a library.
Visit the last successful build: dptran-2.3.4

dptran

A tool to run DeepL translations on your command line.
It's written in Rust, and uses curl to connect to the DeepL API.
To use, you need to get the DeepL API key from https://www.deepl.com/ja/pro-api/.

How to install?

Use crates.io

  1. Install rustup or cargo to your computer.
  2. run this:
$ cargo install dptran

How to use?

Setting API key

Please be sure to get your DeepL API key (it's free!) and set it up on dptran before using the service.

$ dptran set --api-key [API key]

Translate in normal mode

$ dptran Hello
こんにちは
$ dptran -t FR Hello
Bonjour

It is possible to specify the source language with the -f option and the destination language with the -t option. If you omit the destination language option, the translation will be done in Japanese.

For more information about language codes, see the language list:

$ dptran list -s    # for the list of source languages
$ dptran list -t    # for the list of target languages

Translate in interactive mode

$ dptran
> Hello
こんにちは
> Ich stehe jeden Tag um 7 Uhr auf.
毎日7時に起きています。
> Seriously, Hiro, you need to improve your English.
マジでヒロさん、英語力アップしてください。
> 今天玩儿得真开心!
今日は素晴らしい時間を過ごせました
> quit

Multiple source texts can be translated interactively.
Exit with quit.

If you want to translate the source texts into a specific language, use the -t option.

Translate multiple lines

To enter multiple lines, use the -m option.
Then enter a blank line to send the input.

$ dptran -m -t JA
> A tool to run DeepL translations on your command line.
..It's written in Rust, and uses curl to connect to the DeepL API.
..To use, you need to get the DeepL API key from https://www.deepl.com/ja/pro-api/.
..
コマンドラインでDeepL翻訳を実行するためのツールです。
これはRustで書かれており、DeepL APIへの接続にはcurlを使用します。
使用するには、https://www.deepl.com/ja/pro-api/ から DeepL API キーを取得する必要があります。

Translate from the pipeline

You can translate the output of other commands with dptran.

ex: Translate the content of the man page into Japanese

$ man ls | col -b | dptran

Show help

For more information about commands, see help:

$ dptran -h

Displays the number of characters remaining to be translated

$ dptran -u
usage: 222 / 500000 (0%)
remaining: 499778

You can see the number of remaining characters that can be translated by DeepL API. The free DeepL API plan lets you translate up to 500,000 characters per month.

Change default target language

It is set to Japanese (JA) by default.
You can change it with set --target-lang.
For example, to change it to English (EN), do the following:

$ dptran set --target-lang EN

Reset settings

You can reset all settings.
Note: The API key will be reset as well. If you wish to use dptran again, please set the API key again.

$ dptran set --clear

How to uninstall?

$ cargo uninstall dptran