Google Cloud API has to be paid for monthly, Google Translate website, however... is free.
pip install -r requirements.txt
google_translate.py
is currently equipped to use Selenium Chromedriver as it's method to render a web page. If there's any interest in having the choice in which webdriver you want to use, open an issue.
- Download Google Chromedriver.
- Make sure to download the correct version that works with your OS here: https://sites.google.com/chromium.org/driver/home
- Install Chromedriver in your
PATH
so Python can use the webdriver.
google_translate.py
uses a command-line interface. To view all the arguments, run:
python google_translate.py --help
python google_translate.py --output-language Spanish Portuguese
Running this will use the English text from input.txt
, and translate it to Spanish and Portuguese, then dump the original text and translations to output.txt
Copyright (c) Brent Frymire