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

https://github.com/gussf/trnsl8

A translation CLI intended for the learning of Go
https://github.com/gussf/trnsl8

aws-comprehend aws-translate cli go

Last synced: 3 months ago
JSON representation

A translation CLI intended for the learning of Go

Awesome Lists containing this project

README

        

# trnsl8
trnsl8 is a CLI written in Go (using Cobra package) that allows users to translate text and detect the language of input through the use of AWS Translate and AWS Comprehend


## Installation
```sh
go get -u github.com/gussf/trnsl8
```




## Usage

#### Translation
```sh
# Translates text into a target language
# More information on language codes: https://docs.aws.amazon.com/translate/latest/dg/what-is.html
trnsl8 to

# You can input a file to be translated
trnsl8 to -f

# You can save the resulting translation to a file
trnsl8 to -o

# And also both read from and write to files
trnsl8 to -f -o
```

#### Detection
```sh
# Detects what language text is in
trnsl8 detect

# You can also input files for detection
trnsl8 detect -f
```


## Examples

```sh
# Translation
trnsl8 to ja "I want this sentence in japanese"
trnsl8 to en "Ich möchte diesen Satz auf Englisch" -o result.txt
trnsl8 to ro -f ~/source.txt -o ~/result.txt

# Detection
trnsl8 detect "ce limbă este aceasta?" # hint: its romanian!
trnsl8 detect -f really_big_text.txt
```


## Next steps
* Use docker?
* Unit tests?