🚀 We are excited to announce the launch of our very first npm package at Safe Deal: json-i18n-whisper.
Github: Link
NPM: Link
This Node.js tool is designed to streamline the internationalization (i18n) process for developers by translating JSON files using the Google Cloud Translate API (GCPT).
If you're working on projects that require multi-language support, json-i18n-whisper will save you time and effort, allowing you to focus on building great applications rather than worrying about language barriers.
Internationalization is a common challenge for developers, especially when managing projects that cater to a global audience. Traditionally, translating language files for different locales involves a lot of manual work, which can be error-prone and time-consuming. We created json-i18n-whisper to automate this process, making it easier to handle translations efficiently and accurately.
One of the standout features of json-i18n-whisper is its ability to translate JSON files into multiple languages simultaneously. By leveraging the power of the Google Cloud Translate API, this tool can handle a wide range of languages, making it an invaluable asset for any developer working on a global project.
JSON files often contain nested structures, especially in complex applications. json-i18n-whisper intelligently traverses these nested structures, ensuring that every string is accurately translated while preserving the original JSON format.
Understanding the cost implications of translating large files is crucial, especially when working with a service like Google Cloud Translate. json-i18n-whisper includes a built-in cost estimation feature, allowing you to get a clear picture of the expected translation costs before you proceed. This helps in budgeting and avoiding unexpected expenses.
Languages like Hebrew and Arabic require special handling due to their unique linguistic characteristics. json-i18n-whisper automatically removes diacritical marks in these languages to enhance readability and ensure the translations are more natural for native speakers.
Getting started with json-i18n-whisper is straightforward. You can install the package globally via npm or yarn:
npm install -g json-i18n-whisper
# or
yarn global add json-i18n-whisper
Before you begin, make sure you have a Google Cloud Platform account with the Translate API enabled, along with an API key that has access to the Translate API.
Using json-i18n-whisper via the command line is simple. Here's a basic example:translate-json en fr,es,de your_api_key_here
This command will translate your `en.json` file into French, Spanish, and German, creating separate files (`fr.json`, `es.json`, `de.json`) for each language.
You can also import and use the `translateJson` function directly in your Node.js code:const translateJson = require("json-i18n-whisper");
translateJson("en", "fr,es", "your_api_key_here");
This flexibility allows you to integrate json-i18n-whisper into your existing build processes or workflows.
At Safe Deal, we prioritize quality and reliability. That's why json-i18n-whisper is equipped with a comprehensive test suite built with Jest. You can run these tests to ensure everything is working as expected:npm test
# or
yarn test
Our test suite includes both unit tests and integration tests, ensuring that the package performs well under various scenarios.
The release of json-i18n-whisper marks a significant milestone for Safe Deal as we expand our footprint in the open-source community. We believe this tool will be a valuable addition to your development toolkit, making internationalization more accessible and less daunting.
We invite you to explore json-i18n-whisper, try it out in your projects, and share your feedback. Together, we can continue to improve and evolve this tool to meet the needs of developers worldwide.
For more information, check out the npm package page or visit our GitHub repository.
Happy coding! 🌍✨
---
*Safe Deal is committed to empowering developers with tools that simplify complex tasks. json-i18n-whisper is just the beginning of our journey in delivering quality open-source solutions.*
https://www.joinsafedeal.com/