⚠️ Before you start: You must have Docker Desktop installed if you're on Windows or another operating system. This project won’t work without Docker.
This is an AI-powered file translator built for:
- PHP language array files (e.g., Laravel translations)
- JSON files (chome extension language files etc)
- All other formats (PHP, TXT, HTML, XML, etc.)
It uses modern AI models via OpenRouter API to automatically translate files in bulk, with full control over concurrency, batching, retries, and model selection.
git clone https://github.com/wonchoe/ai-php-json-files-language-translator.git
cd ai-php-json-files-language-translator
Build.BAT
(Or double-click Build.BAT
if you're on Windows.)
StartServer.BAT
(Or just double-click StartServer.BAT
.)
- Place your files in the
input/
folder - Open the interface at
http://localhost:3000
- Select the file type:
PHP Arrays
JSON
Plain Text / Other
- Choose one or more target languages (
uk
,fr
,de
, or comma-separated:uk,fr,de
) - Enter your OpenRouter API key
- Click the 🟦 START TRANSLATION button
📝 Translated files will appear in the output/
folder.
/input ← source files to translate
/output ← translated output files
/app ← Node.js translation logic
Inside the browser you can configure:
- File type
- Target languages
- AI model
- API keys
- Max concurrency, retry delay, error threshold, and batch size
After clicking START TRANSLATION
, the system will translate all input/
files and save them in output/
.
Type | Examples |
---|---|
PHP Arrays | .php |
JSON | .json |
Plain/Other | .txt , .html , .xml , .yml , .md , etc. |
✅ Works great for translating Chrome Extension language files (
_locales/.../messages.json
) for SEO localization and international Chrome Web Store presence.
Supports all models available via OpenRouter.ai, including:
google/gemini-2.0-flash-lite-001
openai/gpt-3.5-turbo
anthropic/claude-3-haiku
- Laravel / PHP developers
- App & web developers working with localization files
- SEO experts working on Chrome extensions & multilingual apps
- Anyone who wants to bulk-translate structured files using AI
This project was built to automate the translation of large-scale language files with fine-grained control and blazing speed using OpenRouter-powered AI.