Chanmoro / google-translate-po

Auto-input po-style translation files using Google Translate API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

google-translate-po

Auto-input po-style translation files using Google Translate API.

screenshot

See PR: Translate into English using Google Translate API - c-bata/webframework-in-python or my Japanese blog article.

Setup

This requires Python3 and google-cloud-translate library.

$ pip install -r requirements.txt

Usage

$ export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-credential.json
$ python translate_po.py /path/tp/po_file.po > translated_po_file.po

Help

$ python translate_po.py --help
usage: translate_po.py [-h] [--lang LANG] [--currency CURRENCY] filepath

positional arguments:
  filepath

optional arguments:
  -h, --help           show this help message and exit
  --lang LANG          target language (default: "ja")
  --currency CURRENCY  dollar per your currency. (default currency is yen: 111.90)

LICENSE

MIT License.

About

Auto-input po-style translation files using Google Translate API.


Languages

Language:Python 100.0%