Do easy i18n
A command-line tool and vscode extension for easy internationalization (i18n) management in your projects. Seamlessly initialize, compile, and translate your application messages.
Table of Contents
Features
CLI
- 🚀 Simple Setup: Initialize a new i18n project with a single command
- 🔄 Auto-compilation: Watch for changes and recompile automatically
- 🌐 AI Translation: Automatically translate missing strings with DeepL integration
- 🧩 TypeScript Support: Built with and for TypeScript projects
- 📦 Built for monorepo projects: Built for monorepo projects with any package manager.
VSCode Extension
- 👁️ Inline Visualization: See translations directly in your code with inline decorations
- 🔍 Quick Editing: Edit or delete translations with a single click
- 🔄 Extract Text: Select text and extract it to a translation key
- 🌐 AI Translation: Automatically translate missing strings with DeepL integration
- 🌍 Language Switching: Easily switch between languages to view different translations
- 🚨 Missing Translation Alerts: Visual indicators for missing translations
Installation
CLI
# Install globally
npm install -g do-easy-i18n
# Or use with npx
npx do-easy-i18n <command>
VSCode Extension
The VSCode extension is available in the VSCode Marketplace.
Usage (CLI)
Initialize a new project (CLI)
do-easy-i18n init
This creates:
- A
do-easy-i18n.config.json configuration file
- A
messages directory with an empty en.json file
Compile messages (CLI)
# Basic compilation
do-easy-i18n compile
# With custom config and output paths
do-easy-i18n compile --config ./custom-config.json --output ./custom-output-folder
# Watch mode for automatic recompilation
do-easy-i18n compile --watch
Translate missing messages (CLI)
# Translate using default configuration
do-easy-i18n translate
# With custom config path
do-easy-i18n translate --config ./custom-config.json
Configuration (CLI)
The configuration file (do-easy-i18n.config.json) has the following structure:
{
"languages": ["en", "fr", "es"],
"defaultLanguage": "en",
"deepL": {
"host": "https://api-free.deepl.com",
"apiKey": "your-deepl-api-key"
}
}
| Property |
Description |
languages |
Array of language codes to support |
defaultLanguage |
The source language for translations |
deepL |
DeepL configuration (optional) |
deepL.host |
DeepL API host (free or pro) |
deepL.apiKey |
Your DeepL API key for automatic translations |
Note: The deepL.apiKey is optional. If not provided in the configuration file, the tool will look for the D18N_DEEPL_API_KEY environment variable. For VSCode extension, it can be provided in the extension settings.
Usage (VSCode Extension)
Open your project folder.
Ensure that you have a do-easy-i18n.config.json configuration file in your project.
Import a translation using the pattern import * as.
Use a translation and see the magic happen.

You can switch the decoration language in the status bar.

Decoration colors
- Green color: Translation for
hello key is present in messages/[lang].json files.

- Yellow color: Translation is missing for some languages in messages/[lang].json file.

- Red color: Translation is missing for the selected language in VSCode status bar.

Extension features
With the extension, you can:
- Add a translation key to the current file:

Automatically create a key with the selected text in messages/[lang].json file.

Automatically edit the translation for the selected key in messages/[lang].json file.
- Delete a translation key:

Automatically delete the translation key for the selected language in messages/[lang].json file.
- Translate a missing translation key using DeepL:

- The extension will try to use the
defaultLanguage to translate missing translations. If a source translation is missing, the extension will fallback to the first one available with same key.
License
MIT