Simple translation frontend, forked from https://git.sr.ht/~yerinalexey/gtranslate.
Go to file
Alexey Yerin 6feb20c8e8 Mention --proxy in Tor setup 2021-01-22 12:37:27 +03:00
static Refactor CSS, small style updates 2021-01-18 21:59:14 +03:00
templates Add missing ids to inputs 2021-01-18 22:27:05 +03:00
.gitignore Initial 2021-01-17 23:19:52 +03:00
LICENSE Initial 2021-01-17 23:19:52 +03:00
README.md Mention --proxy in Tor setup 2021-01-22 12:37:27 +03:00
go.mod Initial 2021-01-17 23:19:52 +03:00
go.sum Initial 2021-01-17 23:19:52 +03:00
main.go Remove --tor option 2021-01-22 12:20:27 +03:00
translate.go Move request logic to a different function 2021-01-18 23:25:21 +03:00

README.md

gtranslate

Better front-end for Google Translate that doesn't track you and works without JavaScript.

Installation

git clone https://git.sr.ht/~yerinalexey/gtranslate
cd gtranslate

go build

Then run the server with

./gtranslate

If you want to use a different port:

./gtranslate -b :3000 # will run on port 3000

Note: if you're running it outside of development environment, you should pass --template-dir and --static-dir arguments pointing to templates and static directories:

./gtranslate \
  --template-dir /usr/share/webapps/gtranslate/templates \
  --static-dir   /usr/share/webapps/gtranslate/static

Other settings (available with ./gtranslate --help):

Usage of ./gtranslate:
  -b, --bind string           Address to bind the server to, [addr]:port (default ":5000")
      --proxy string          Proxy URL, with no scheme http is assumed
      --static-dir string     Static files directory (default "./static")
      --template-dir string   Templates directory (default "./templates")
      --user-agent string     User-Agent header to use

If you want to proxy requests through Tor network, it's a good idea to set User-Agent of Tor Browser so it will be harder to identify such servers:

./gtranslate \
  --user-agent "Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0" \
  --proxy socks5://localhost:1080 \ # Set `Socks5Proxy localhost` in Tor config
  ...

Source

TODO

  • Proper language selector
  • Dark theme