Skip to content
Tool to translate strings in a JSON document.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
.editorconfig Initial impl. Transformer for Yandex and Google Translate. Feb 23, 2017
.gitignore Add more tests Oct 27, 2017
.prettierignore
.travis.yml Move from Codacy to Coveralls. Oct 27, 2017
LICENSE
README.markdown
package-lock.json 2.1.3 Mar 24, 2018
package.json
strings.json Move input and output out of index.js, add more verbose errors, fix v… Oct 31, 2017
translate-json

README.markdown

translate-json

npm version Build Status Coverage Status tested with jest code style: prettier

Tool to translate strings in a JSON document.

Install

npm i -g translate-json

Usage

Usage:
  translate-json [options] -l <language> (- | <input>) [<output>]
  translate-json [options] --lang=<language> (- | <input>) [<output>]

Options:
  -t, --translator              The translation service to use: google (default), yandex, bing.
  -k, --api-key                 The API key to be used with the translation service. (Not needed for google.)
  -p, --preserve-html-entities  Preserve HTML entities in translated text. (False by default.)
  -c, --concurrency             Number of fields to translate simultaneously. (Default is 30)
  -e, --exclude                 Regular expression to exclude key paths. e.g. '^(notThis|this|not.this.either)$'
  -d, --dry-run                 Do not actually translate any values, prefix strings with 'zz_' to mark them.
  -h, --help                    Show this screen.
  -v, --version                 Show version.
  --verbose                     Log more.

Examples:
  translate-json --lang=ru ./labels.json ./labels-ru.json
  translate-json -d --lang=ru ./labels.json ./labels-ru.json
  translate-json -c 60 --preserve-html-entities --lang=ru ./labels.json ./labels-ru.json
  cat input.json | translate-json -l ru - > output.json
You can’t perform that action at this time.