strapi-ai-translator
v0.14.0
Published
AI-Powered Content Translation for Strapi
Readme
Strapi LLM Translator
AI-Powered Content Translation for Strapi
The Strapi LLM Translator plugin enhances your localization workflow by utilising LLMs to translate your content fields with a single click. Compatible with OpenAI and Google Gemini APIs, it preserves your original formatting while delivering fast, accurate results in seconds.
🚀 Key Features
- 🌍 Multi-field Support - Translates all text-based fields (string, text, richtext) and JSON/Blocks content, including Strapi 5 structured rich text
- 🔌 Multi-Provider Support - Works with OpenAI and Google Gemini APIs
- 📝 Format Preservation - Maintains markdown formatting during translation
- 🔗 Smart UUID Handling - Auto-translates slugs when i18n is enabled with relative fields
- ⚡ Auto-fill - Instantly populates generated translations
- 🎛️ Customizable - Adjust system prompts and temperature for optimal results
✅ Tested With
- Strapi: v5.12.x, v5.15.x
- LLM Providers:
- OpenAI:
gpt-4o,gpt-3.5-turbo - Google Gemini:
gemini-1.5-flash,gemini-1.5-pro - Groq:
meta-llama/llama-4-scout-17b-16e-instruct(OpenAI-compatible) - Local:
Ollama, e.g.phi4-mini(OpenAI-compatible)
- OpenAI:
🛠️ Installation & Setup
Prerequisites
- Strapi project (v5+)
- API key for your preferred LLM provider, Base Url + Model Name
- Configured internationalization with at least two languages in your Strapi application
Installation
- Install the plugin in your Strapi project:
npm install strapi-ai-translator- Configure environment variables:
For OpenAI:
# Your OpenAI API key
LLM_TRANSLATOR_LLM_API_KEY=sk-your-openai-key
# Optional - Defaults to OpenAI's endpoint
STRAPI_ADMIN_LLM_TRANSLATOR_LLM_BASE_URL=https://api.openai.com/v1
# Optional - Defaults to gpt-4o
STRAPI_ADMIN_LLM_TRANSLATOR_LLM_MODEL=gpt-4o
# Optional - Defaults to openai
STRAPI_ADMIN_LLM_TRANSLATOR_LLM_PROVIDER=openaiFor Google Gemini:
# Your Google AI API key
LLM_TRANSLATOR_LLM_API_KEY=your-gemini-api-key
# Optional - Defaults to gemini-1.5-flash
STRAPI_ADMIN_LLM_TRANSLATOR_LLM_MODEL=gemini-1.5-flash
# Set provider to gemini
STRAPI_ADMIN_LLM_TRANSLATOR_LLM_PROVIDER=geminiFor other OpenAI-compatible providers (Groq, Ollama, etc.):
# Your provider API key
LLM_TRANSLATOR_LLM_API_KEY=your-api-key
# Your provider's endpoint
STRAPI_ADMIN_LLM_TRANSLATOR_LLM_BASE_URL=https://api.groq.com/openai/v1
# Your provider's model
STRAPI_ADMIN_LLM_TRANSLATOR_LLM_MODEL=meta-llama/llama-4-scout-17b-16e-instruct
# Set provider to openai (for OpenAI-compatible APIs)
STRAPI_ADMIN_LLM_TRANSLATOR_LLM_PROVIDER=openai- Rebuild your admin panel:
npm run buildAfter installation, customize the translation behavior through the LLM Translator configuration page:
💻 Plugin Development
To contribute to the plugin development:
- Navigate to your Strapi project
- Add and link the plugin:
npx yalc add strapi-ai-translator && npx yalc link strapi-ai-translator && npm install - Start your Strapi project
- In a separate terminal, watch the plugin for changes:
npm run watch:link
About
Nirbhay Singh (nirbhay) – nirbhay.online
Distributed under the MIT license.
See LICENSE for more information.
