CLI tool for JSON/YAML translation using multiple AI/free modules
Top 57.8% on sourcepulse
This tool provides a command-line interface (CLI) and a JavaScript/TypeScript library for translating JSON and YAML files. It supports multiple translation services, including free options like Google Translate, Bing Translate, Libre Translate, and Argos Translate, as well as paid options like DeepL and various OpenAI GPT models. The primary benefit is automating the localization of structured data.
How It Works
The project leverages a modular architecture, allowing users to select different translation APIs. It handles the parsing of JSON and YAML files, extracts translatable strings, sends them to the chosen translation service, and then reconstructs the translated files. The library also includes features for ignoring specific placeholders (e.g., {{name}}
) and URLs during translation to preserve formatting and variables.
Quick Start & Requirements
npm i -g @parvineyvazov/json-translator
(for CLI) or npm i @parvineyvazov/json-translator
(for library).jsontt <your/path/to/file.json>
or jsontt <your/path/to/file.yaml>
.DEEPL_API_KEY
or OPENAI_API_KEY
).Highlighted Details
{{variable}}
during translation.Maintenance & Community
The project is maintained by mololab. Community interaction and support are available via Twitter.
Licensing & Compatibility
The package is licensed under the MIT license, permitting commercial use and integration into closed-source projects.
Limitations & Caveats
Browser support is listed as "coming soon." Some advanced features like filtering fields during file translation are still in the roadmap. The README mentions that higher concurrency limits can lead to API bans.
7 months ago
1 day