Skip to content
/ trnsl8 Public

A translation CLI intended for the learning of Go

License

Notifications You must be signed in to change notification settings

gussf/trnsl8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

go get -u github.com/gussf/trnsl8

Usage

Translation

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

# You can input a file to be translated
trnsl8 to <language-code> -f <source-text-file>

# You can save the resulting translation to a file
trnsl8 to <language-code> <text-to-translate> -o <output-file>

# And also both read from and write to files
trnsl8 to <language-code> -f <source-text-file> -o <output-file>

Detection

# Detects what language text is in
trnsl8 detect <text-to-detect> 

# You can also input files for detection
trnsl8 detect -f <text-file>

Examples

# 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?

About

A translation CLI intended for the learning of Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages