A simple translation system using multi-agent collaboration. Three AI agents work together to produce high-quality translations:
- 🤖 Translator Agent (OpenAI GPT-4o) - Translates content from English to target language
- 📝 Editor Agent (Google Gemini) - Reviews translations for grammar, phrasing, and cultural appropriateness
- 🔧 Technical Reviewer Agent (Google Gemini) - Ensures XML format, placeholders, and technical correctness
pip install -r requirements.txtCopy the example config and add your OpenAI API key:
cp config.yaml.example config.yamlThen edit config.yaml:
openai:
api_key: "your-api-key-here"
base_url: "https://api.openai.com/v1"
model: "gpt-4o"The system supports multiple input formats:
| Format | File | Platform |
|---|---|---|
| 🤖 Android XML | input/strings.xml |
Android Mobile |
| 🍎 iOS Strings | input/strings_ios.strings |
iOS Mobile |
| 🔧 Backend JSON | input/strings_backend.json |
Backend Services |
| 📄 Backend TOML | input/strings_backend.toml |
Backend Services |
Each format includes placeholder examples (%s, %d, {variable}, %@) to test placeholder handling.
Run the Streamlit app for a visual interface:
streamlit run app.pyThen open your browser to http://localhost:8501
✨ Features:
- 📁 Select input files from dropdown
- 🌍 Choose target languages
- 📋 View processing logs in real-time
- 🤖 See each agent's response
- 📦 View formatted results
# Android XML
python main.py --path input/strings.xml
# iOS Strings
python main.py --path input/strings_ios.strings
# Backend JSON
python main.py --path input/strings_backend.json
# Backend TOML
python main.py --path input/strings_backend.tomlpython main.py --path input/strings.xml --languages zh,ja,kopython main.py --path input/strings.xml --config my-config.yamlEdit config.yaml to customize:
- 🔑 openai: API credentials and model settings
- 🌍 translation.languages: Default target languages
- 📝 translation.max_editor_reviews: Maximum editor review rounds (default: 2)
- 🔧 translation.max_technical_reviews: Maximum technical review rounds (default: 2)
- 📁 output.directory: Output folder (default: results)
- 🏷️ output.prefix: Output file prefix (default: v1)
📄 Input File
│
▼
🤖 [Translator Agent] ──► Produces initial translation
│
▼
📝 [Editor Agent] ──► Reviews language quality
│ • Grammar
│ • Natural phrasing
│ • Cultural appropriateness
▼
🔧 [Technical Reviewer] ──► Checks technical correctness
│ • XML format
│ • Placeholders intact
│ • Special characters
▼
📦 Output File
The agents communicate through a feedback loop. If issues are found, the Translator receives feedback and revises the translation until both reviewers approve. ✅
Default languages configured:
- 🇨🇳 zh (Chinese)
- 🇯🇵 ja (Japanese)
- 🇰🇷 ko (Korean)
- 🇹🇭 th (Thai)
- 🇲🇾 ms (Malay)
- 🇻🇳 vi (Vietnamese)
- 🇮🇩 id (Indonesian)
- 🇰🇭 km (Khmer)
Translated files are saved to the results/ folder with naming format:
{prefix}_{language}_{original_filename}
Example: v1_zh_strings.xml