ciceron v1.1.1
Ciceron
ciceron is an npm package that translates file comments from an auto-detected language to another language using the DEEPL© API.
Table of Contents
- 🌟 Features
- 📌 Prerequisite
- 📦 Installation
- 📖 Usage
- ⚙️ Configuration
- 🈯 Supported Languages
- 🧩 Dependencies
- 📄 License
- ✍🏻 Author
🌟 Features
- Translate file comments from an auto-detected language to another language.
- Replace the original files or generate new files.
- Supports multiple languages.
- Easy to install. Easy to configure. Easy to use.
📌 Prerequisite
You need a DEEPL API key to use ciceron. If you don't have one yet, go to DEEPL to create a free account (up to 500.000 words / months with the free plan ) !
📦 Installation
We recommend installing ciceron globally:
npm i -g ciceronIf you prefer to install ciceron locally, we recommend adding it to your project dev dependencies:
npm i ciceron --save-dev Then, add a new script in your package.json:
"scripts": {
"translate": "ciceron translate"
}Finally, run the following command in your terminal:
npm run translate <file>You will then be prompted to select the target language and choose whether to replace the original files or generate a new file.
📖 Usage
🖥️ CLI Command
💾 If ciceron is installed globally, run:
ciceron translate <file>Example
# drag and drop the file
ciceron translate ./src/example.js
# or write the file name in plain text
ciceron translate example.jsYou will then be prompted to select the target language and choose whether to replace the original files or generate a new file.
🌐 If ciceron is neither installed globally nor locally, you still can run:
npx ciceron translate <file>Example
# drag and drop the file
npx ciceron translate ./src/example.js
# or write the file name in plain text
npx ciceron translate example.jsYou will then be prompted to select the target language and choose whether to replace the original files or generate a new file.
⚙️ Configuration
ciceron requires a short configuration.
Make sure to install dotenv locally:
npm i dotenvSet your DEEPL API key in the .env file at the root of your project:
// myproject/.env
DEEPL_API_KEY=your_deepl_api_keyNote: With DEEPL's free offer, you have access to an API credit of 500,000 words per month.
🈯 Supported Languages
ciceron supports the following languages:
- English 🇬🇧
- French 🇫🇷
- German 🇩🇪
- Italian 🇮🇹
- Spanish 🇪🇸
- Dutch 🇳🇱
- Portuguese 🇵🇹
- Japanese 🇯🇵
- Korean 🇰🇷
- Chinese (simplified) 🇨🇳
- Ukrainian 🇺🇦
- Russian 🇷🇺
🧩 Dependencies
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
✍🏻 Author
Louis-Antonin Lesieur