v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-18 08:40:35 -07:00
eeeXun cbd985b599 refactor: make Language, TTSLock and EngineName to struct in Translator
GetSrcLang, GetDstLang, SetSrcLang, SetDstLang, SwapLang are reusable
functions from translator to translator. So make Language struct.

GetEngineName is also a reusable function. So make EngineName struct.

Finally, let Translator to inherit those functions in these three
(Language, TTSLock, EngineName) structs. No need to write the duplicated
functions for each Translator.
2023-03-10 23:37:08 +08:00
2023-02-11 14:23:07 +08:00
2023-01-19 12:06:20 +08:00
2023-02-11 14:23:07 +08:00
2022-10-24 23:43:20 +08:00
2023-02-09 12:36:51 +08:00

gtt

Google Translate TUI (Originally)

Support: ApertiumTranslate, ArgosTranslate, GoogleTranslate ReversoTranslate

ScreenShot

screenshot

Install

Arch Linux (AUR)

yay -S gtt-bin

Prebuild

Binary file is available in Release Page for Linux and macOS on x86_64.

From source

go install github.com/eeeXun/gtt@latest

Run on Docker

docker run -it eeexun/gtt

Language in argument

You can pass -src and -dst in argument to set source and destination language.

gtt -src "English" -dst "Chinese (Traditional)"

See language on:

Key Map

<C-c> Exit program.

<Esc> Toggle pop out window.

<C-j> Translate from source to destination window.

<C-s> Swap language.

<C-q> Clear all text in source of translation window.

<C-y> Copy selected text.

<C-g> Copy all text in source of translation window.

<C-r> Copy all text in destination of translation window.

<C-o> Play sound on source of translation window.

<C-p> Play sound on destination of translation window.

<C-x> Stop play sound.

<C-t> Toggle transparent.

<C-\> Toggle Definition/Example & Part of speech.

<Tab>, <S-Tab> Cycle through the pop out widget.

<1>, <2>, <3> Switch pop out window.

Dependencies

xclip for Linux/X11 to copy text.

wl-clipboard for Linux/Wayland to copy text.

pbcopy For macOS to copy text.

Credit

soimort/translate-shell, SimplyTranslate-Engines, s0ftik3/reverso-api For translation URL.

snsd0805/GoogleTranslate-TUI For inspiration.

turk/free-google-translate For Google translate in Golang.

Description
Google Translate TUI
Readme MIT 5.1 MiB
Languages
Go 99.1%
Shell 0.6%
Dockerfile 0.3%