1.0.5 • Published 4 years ago
@garfieldchou/vgt v1.0.5
vgt
Use google translation client library to translate text in xlsx
Install
npm install -g @garfieldchou/vgt
Configuration
- Create a json file for configuration, e.g. config.json
Specify the following properties in the json file
- inputXlsxFile (input .xlsx file name)
- inputSheet (the sheet name in the xlsx file)
- columnToTranslate (the column name in the sheet)
- targetLang (specify the languages which you'd like to translate)
- outputXlsxFile (output filename)
- outputSheet (the sheet name in the output xlsx file)
- client_email (your service account)
- private_key (your private key associated with the translation API service account)
Sample config.json
{
"inputXlsxFile": "D:\\source\\source.xlsx",
"inputSheet": "source-sheet",
"columnToTranslate": "source-column",
"targetLang": ["en", "zh-TW"],
"outputXlsxFile": "translated.xlsx",
"outputSheet": "translated_sheet",
"client_email": "account-qwerasdf@12345678.iam.gserviceaccount.com",
"private_key": "-----BEGIN PRIVATE KEY-----\nqwerasdf\n-----END PRIVATE KEY-----\n"
}
Run
vgt -f config.json
License
ISC