dt

command module
v0.0.0-...-5d374b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 1 Imported by: 0

README

dt (DeepL Translation)

Go License

A simple command line application to translate with DeepL API.

This application only supports DeepL API Free, and does not currently support other APIs.

Installing

go install github.com/kinpoko/dt@latest

Usage

  1. Obtain an authentication key for the DeepL API. For information on how to obtain an authentication key, please see the official documentation.
  2. Set the authentication key as an environment variable named DEEPL_TOKEN.

.bashrc

export DEEPL_TOKEN=<authentication key>
  1. Translate text using the following command:
dt Hello World
ハロー・ワールド

Use the -h flag to view the help menu and command line options:

dt -h
A simple command line application to translate with deepl API.

Usage:
  dt [text] [flags]

Flags:
  -h, --help            help for dt
  -s, --source string   source language   (default "en")
  -t, --target string   target language   (default "ja")

Using Pipe

You can use dt with other command line utilities by piping text to the application. For example, to translate the contents of a file named text.txt, you can use the following command:

cat text.txt | xargs dt

This will translate the text in the text.txt file and output the resulting translation to the command line.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL