https://github.com/lukechannings/translate-json
Tool to translate strings in a JSON document.
https://github.com/lukechannings/translate-json
bing-translate cli-utilities google-translate localization translates-json yandex-translate
Last synced: 19 days ago
JSON representation
Tool to translate strings in a JSON document.
- Host: GitHub
- URL: https://github.com/lukechannings/translate-json
- Owner: LukeChannings
- License: mit
- Created: 2017-02-22T21:15:28.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-12T14:19:34.000Z (about 2 years ago)
- Last Synced: 2025-04-15T05:07:35.763Z (19 days ago)
- Topics: bing-translate, cli-utilities, google-translate, localization, translates-json, yandex-translate
- Language: JavaScript
- Size: 517 KB
- Stars: 13
- Watchers: 1
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
translate-json
=====[](https://www.npmjs.com/package/translate-json)

[](https://github.com/facebook/jest)
[](https://github.com/prettier/prettier)Tool to translate strings in a JSON document.
## Install
npm i -g translate-json
## Usage
Usage:
translate-json [options] -l (- | ) []
translate-json [options] --lang= (- | ) []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.
-p, --preserve-html-entities Preserve HTML entities in translated text. (False by default.)
-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 --preserve-html-entities --lang=ru ./labels.json ./labels-ru.json
cat input.json | translate-json -l ru - > output.json