support 
Contact with me on Twitter to advertise your project on jsontt cli
✨ Sponsored by fotogram.ai - Transform Your Selfies into Masterpieces with AI ✨
✨ https://fotogram.ai ✨
🚀 AI / FREE JSON & YAML TRANSLATOR 🆓
This package will provide you to translate your JSON/YAML files or JSON objects into different languages FREE.
🥷 CLI Support:
Translation Module | Support | FREE |
---|---|---|
Google Translate | ✅ | ✅ FREE |
Google Translate 2 | ✅ | ✅ FREE |
Microsoft Bing Translate | ✅ | ✅ FREE |
Libre Translate | ✅ | ✅ FREE |
Argos Translate | ✅ | ✅ FREE |
DeepL Translate | ✅ | require API KEY (DEEPL_API_KEY as env) optional API URL (DEEPL_API_URL as env) |
gpt-4o | ✅ | require API KEY (OPENAI_API_KEY as env) |
gpt-3.5-turbo | ✅ | require API KEY (OPENAI_API_KEY as env) |
gpt-4 | ✅ | require API KEY (OPENAI_API_KEY as env) |
gpt-4o-mini | ✅ | require API KEY (OPENAI_API_KEY as env) |
⏳ Package Support:
Translation Module | Support | FREE |
---|---|---|
Google Translate | ✅ | ✅ FREE |
Google Translate 2 | ✅ | ✅ FREE |
Microsoft Bing Translate | ✅ | ✅ FREE |
Libre Translate | ✅ | ✅ FREE |
Argos Translate | ✅ | ✅ FREE |
DeepL Translate | ✅ | require API KEY (DEEPL_API_KEY as env) optional API URL (DEEPL_API_URL as env) |
gpt-4o | ✅ | require API KEY (OPENAI_API_KEY as env) |
gpt-3.5-turbo | ✅ | require API KEY (OPENAI_API_KEY as env) |
gpt-4 | ✅ | require API KEY (OPENAI_API_KEY as env) |
gpt-4o-mini | ✅ | require API KEY (OPENAI_API_KEY as env) |
Browser support will come soon...
✅ Install
OR you can install it globally (in case of using CLI)
1. 💫 CLI Usage
How to use it? (video below)
Arguments
[path]
: Required JSON/YAML file path<your/path/to/file.json>
[path]
: optional proxy list txt file path<your/path/to/proxy_list.txt>
Options
Examples
Translate a JSON file using Google Translate:
with output name
with fallback logic (try other possible translation modules on fail)
set concurrency limit (higher faster, but easy to get banned | default: 3)
other usage examples
translate (json/yaml)
with proxy (only Google Translate module)
Result will be in the same folder as the original JSON/YAML file.
help
2. 💥 Package Usage
1. Translate a word | sentence
Import the library to your code.
For JavaScript
For TypeScript:
2. Translate JSON object (supports deep objects)
Import the library to your code
For JavaScript
For TypeScript:
3. Translate JSON object into Multiple languages (supports deep objects)
Import the library to your code
For JavaScript
For TypeScript:
4. Translate JSON file (supports deep objects)
Import the library to your code.
For JavaScript
For TypeScript:
5. Translate JSON file into Multiple languages (supports deep objects)
Import the library to your code.
For JavaScript
For TypeScript:
6. Ignore words
To ignore words on translation use {{word}}
OR {word}
style on your object.
jsontt also ignores the
URL
in the text which means sometimes translations ruin the URL in the given string while translating that string. It prevents such cases by ignoring URLs in the string while translating.You don't especially need to do anything for it, it ignores them automatically.
How to contribute?
Clone it
Install dependencies (with using yarn - install yarn if you don't have)
Show the magic:
Update CLI
Go to file
src/cli/cli.ts
Update translation
Go to file
src/modules/functions.ts
Update JSON operations(deep dive, send translation request)
Go to file
src/core/json_object.ts
Update JSON file read/write operations
Go to file
src/core/json_file.ts
Update ignoring values in translation (map/unmap)
Go to file
src/core/ignorer.ts
Check CLI locally
For checking CLI locally we need to link
the package using npm
Or you can run the whole steps using make
Make sure your terminal has admin access while running these commands to prevent any access issues.
🏞 Roadmap🏁
✔️ Translate a word | sentence
for JSON objects
✔️ Translate JSON object
✔️ Translate deep JSON object
✔️ Multi language translate for JSON object
Translate JSON object with extracting OR filtering some of its fields
for JSON files
✔️ Translate JSON file
✔️ Translate deep JSON file
✔️ Multi language translate for JSON file
Translate JSON file with extracting OR filtering some of its fields
General
✔️ CLI support
✔️ Safe translation (Checking undefined, long, or empty values)
✔️ Queue support for big translations
✔️ Informing the user about the translation process (number of completed ones, the total number of lines and etc.)
✔️ Ignore value words in translation (such as ignore {{name}} OR {name} on translation)
✔️ Libre Translate option (CLI)
✔️ Argos Translate option (CLI)
✔️ Bing Translate option (CLI)
✔️ Ignore URL translation on given string
✔️ CLI options for languages & source selection
✔️ Define output file names on CLI (optional command for CLI)
✔️ YAML file Translate
✔️ Fallback Translation (try new module on fail)
✔️ Can set the concurrency limit manually
Libre Translate option (in code package)
Argos Translate option (in code package)
Bing Translate option (in code package)
Openrouter Translate module
Cohere Translate module
Anthropic/Claude Translate module
Together AI Translate module
llamacpp Translate module
Google Gemini API Translate module
Groq support - Full list as new Translate modules
✔️ ChatGPT support
Sync translation
Browser support
Translation Option for own LibreTranslate instance
Make "--" dynamically adjustable (placeholder of not translated ones).
Update name -> prefix in CLI / Ability to pass empty to prefix in CLI (better for autonomous tasks)
--prettyPrint
to CLI which will print json in a pretty way
License
@parvineyvazov/json-translator will be available under the MIT license.