Automatically detects missing translations in i18n JSON files and fills them using AI-powered translation APIs like Google Translate, DeepL, OpenAI (GPT-4), and Gemini.
✅ Keep your translations consistent and up-to-date effortlessly!
✔️ Detect missing translations in structured JSON files
✔️ Automatically translate missing texts using AI-based APIs
✔️ Supports multiple translation services:
- Google Translate 🌍
- DeepL 📖
- OpenAI (GPT-4) 🤖
- Gemini (Google AI) 🔥
✔️ CLI tool for easy project integration
✔️ Supports nested JSON structures
✔️ Customizable API settings via CLI or.envfile
Install globally via NPM:
npm install translation-autocompleteor use without installation:
npx translation-autocomplete --helpFind missing translations in your localization files:
npx translation-autocomplete checkExample Output:
❌ Missing translations found:
- home.hero.title (en → tr)
- home.hero.subtitle (en → tr)Automatically translate missing entries using AI-powered services:
npx translation-autocomplete check --fix✅ This command fills missing translations and updates JSON files.
Example Output:
✅ home.hero.title → "Ana Sayfa Başlığı" (Translated using Google Translate)
✅ home.hero.subtitle → "Ana Sayfa Alt Başlığı" (Translated using Google Tanslate)You can set up API keys and preferences via CLI:
npx translation-autocomplete configThis allows you to configure:
- Translation API key
- Source & target languages
- Translation service (Google, DeepL, OpenAI, Gemini)
- JSON file path
Alternatively, create a .env file to store API settings:
TRANSLATION_API_KEY=your-api-key
SOURCE_LANGUAGE=en
TARGET_LANGUAGES=tr,es,de
TRANSLATION_SERVICE=google
I18N_PATH=./src/messagesSupported Services:
google→ Google Translatedeepl→ DeepLopenai→ OpenAI GPT-4gemini→ Google Gemini
Translation files should be in nested JSON format, like this:
📂 English (en.json)
{
"home": {
"hero": {
"title": "Welcome to My Portfolio",
"description": "I build modern web applications."
},
"contact": {
"cta": "Get in Touch"
}
}
}📂 Turkish (tr.json)
{
"home": {
"hero": {
"title": "Portföyüme Hoş Geldiniz"
}
}
}✅ check --fix will automatically fill missing translations in tr.json.
| Command | Description |
|---|---|
npx translation-autocomplete check |
Detect missing translations |
npx translation-autocomplete check --fix |
Auto-translate missing entries |
npx translation-autocomplete config |
Configure API settings |
npx translation-autocomplete --help |
Show help menu |
Supports any language that is available on Google Translate, DeepL, OpenAI, or Gemini.
MIT License © 2025 Selman Yasin Aktaş
🔹 Found a bug? Open an Issue
🔹 Want to improve the project? Submit a Pull Request
🔹 Like this project? ⭐ Star it on GitHub!
- ✅ Saves time by automatically filling missing translations
- ✅ AI-powered translations for accuracy
- ✅ CLI-based and easy to integrate into any project
- ✅ Supports multiple translation services
If you have any questions or feedback, feel free to open an issue or reach out via GitHub discussions.
Run this command and ensure your translations are always up-to-date:
npx translation-autocomplete check --fix🔹 Happy Coding! 🚀🎯