Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 1.29 KB

README.md

File metadata and controls

30 lines (26 loc) · 1.29 KB

gTranslator

Translate a wording json file.

In the process of the translation of your project, you can use this tool to automatically translate the wordings you list in a structured json file (example in input.json). It uses Google translate.

Installation

  1. Clone repository git clone https://github.com/scorring/gTranslator.git then cd gTranslator
  2. Create a python virtualenv If it is not already installed, install the package python-virtualenv. Then create a new virtualenv in the projec folder: virtualenv venv then source venv/bin/activate
  3. Install requirements pip install -r requirements.txt
  4. Install Chromedriver For now, we use chrome in this project. To install chrome driver for selenium, visit https://sites.google.com/a/chromium.org/chromedriver/, download the driver and move it to gTranslator/chromedriver or modify the chromedriver_path in the config.py file.

Configuration

Open the config.py file and set your own settings:

  • chromedriver_path: Path for chromedriver file
  • in_path: Path for input json file
  • out_path: Path for output json file
  • in_language_code: Language for the input json file (default: en)
  • out_language_code: Language for the output json file (default: fr)

Run

python translator.py The result is saved into out.json by default