@medanosol/translation-tool v0.0.8
Introduction
translation-tool is a tool that allows you to translate your i18n files in a simple and fast way. You can manually translate the files or use the Deepl API to translate them automatically.
Why
The idea of this tool is to facilitate the translation of i18n files, since it is a tedious task to do it manually. As devs, we are always looking for ways to automate tasks and this is one of them.
Install
Install the package using your favorite package manager.
With yarn
yarn add @medanosol/translation-tool --dev
With npm
npm install @medanosol/translation-tool -D
Getting started
Once you have installed the package, add the following command to your package.json file.
"scripts": {
"translate": "translation-tool"
}
Then, when you run the command yarn translate
or npm run translate
, the tool will start at port 3000 by default. You can change the port by adding the following command to your package.json file.
"scripts": {
"translate": "translation-tool --port 3001"
}
Setting up the Deepl API
To use the Deepl API, you need to create an account on their website and get an API key. You can create an account here: Deepl API. Their free plan allows you to translate 500,000 characters per month, so for most projects it will be more than enough.
How to use
You just need to add the API key before you start trasnlating your files. If you want to skip doing this every time you open the tool, we added a way to save your API key in the browser's local storage. To do this, just click on the "Save API Key" button and the next time you open the tool, it will automatically load your API key. It's encrypted, so don't worry about security. If you still don't feel safe, you can always delete it from the local storage and add it manually every time you open the tool.
Supported languages
Manually, you can translate your i18n files to any language you want. But if you want to use the Deepl API, you can only translate languages listed on the Deepl API Documentation: Deepl API Docs
License
MIT License