Skip to content
forked from fedeztk/got

Translating TUI written in go using simplytranslate's API

License

Notifications You must be signed in to change notification settings

Albertchamberlain/got

 
 

Repository files navigation

got

GO GHCR AUR Go Report Card

Table of Contents

Demo - Usage - Features - Testing

go-translation (shortly got), a simple translator and text-to-speech app build on top of simplytranslate's APIs and the awesome bubbletea tui library.

Screenshots here

Disclaimer: this is my absolute first project in golang, so bugs and clunky code are expected…

The project is still a work-in-progress, breaking changes and heavy refactoring may happen

Demo

Kooha-05-01-2022-18-10-58.mp4

Usage

  • Install got:

With the go tool:

go install github.com/fedeztk/got/cmd/got@latest

Or from source:

# clone the repo
git clone https://github.com/fedeztk/got.git
# install manually 
make install

In both cases make sure that you have the go bin directory in your path:

export PATH="$HOME/go/bin:$PATH"

If you are an Arch user there is also an AUR package available:

paru -S go-translation-git
  • Copy the sample config file under ~/.config/got/ as config.yml or let the program generate one for you at the first run
  • Run it interactively:
got            # use last used engine, default is google
got -e reverso # change engine to reverso
  • Or in oneshot mode:
got -o -s en -t it "Hello World"          # use default (google)
got -o -e libre -s en -t it "Hello World" # use libre-translate

For more information check the help (got -h)

Features

  • Interact with various translation engines easily via the terminal, no need to open a browser!
  • Clean interface with 3 tabs, switch between them with tab/shift-tab:
    • text input: input the sentence you want to translate, press enter to translate image
    • language selection: choose between 108 languages, select source language with s, target with t and i to invert the target with the source. Press ? to show the full help menu image Full help: image
    • translation: pager that shows the result of translation. Copy translation with y, listen the translation with p image
  • engines: choose between google, libre-translate, reverso and iciba (deepl is not working yet)
  • quit anytime with esc or ctrl-c
  • automatically remembers the last languages used

Testing

Development is done through docker, build the container with:

make docker-build

Check that the build went fine:

docker images | grep got

Test it with:

make docker-run

Pre-built Docker image available here

About

Translating TUI written in go using simplytranslate's API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 93.1%
  • Shell 3.5%
  • Dockerfile 2.0%
  • Makefile 1.4%