Ronanxyz
3 months ago
## Technical Details
*Why Go?* I chose Go over Python for several reasons: - *Performance*: Concurrent batch processing with goroutines - *Reliability*: Static typing catches errors at compile time - *Distribution*: Single binary, no runtime dependencies - *Production-ready*: Built-in error handling, testing, and logging
*Architecture* Clean architecture with domain-driven design: - *Presentation Layer*: CLI (Cobra) + Terminal UI (Lipgloss) - *Application Layer*: Workflow orchestration - *Domain Layer*: Translation engine, reflection engine, terminology manager - *Infrastructure Layer*: AI provider adapters, JSON repository
*Reflection Implementation* The agentic reflection adds overhead (3x API calls per batch): - Batch size: 20 keys (configurable) - Example: 100 keys = 5 batches = 15 API calls (5 translate + 5 reflect + 5 improve) - Trade-off: 3x cost for significantly higher quality
You can adjust `--batch-size` based on your needs: - Smaller batches (10): More reliable, better quality, higher cost - Larger batches (50): More efficient, lower cost, slightly lower quality
*Supported AI Providers* - *OpenAI*: GPT-5, GPT-5 mini, GPT-5 nano, GPT-4o, etc. - *Anthropic*: Claude Sonnet 4.5, Claude Haiku 4.5, Claude Opus 4.1, etc. - *Gemini*: Gemini 2.5 Flash, Gemini 2.5 Pro, etc.
You can use any model from these providers. Generally: - Larger models → better reflection insights → higher quality - Faster models → quicker processing → lower cost - Balance: GPT-4o, Claude 3.5 Sonnet, Gemini 1.5 Pro
*Format Protection* Regex-based preservation of: - Placeholders: `{var}`, `{{var}}`, `%s`, `%(name)d` - HTML tags: `<b>`, `<span class="highlight">` - URLs: `https://example.com` - Markdown: `*bold*`, `italic`, `[link](url)`
*RTL Support* Proper bidirectional text handling for Arabic, Hebrew, Persian, Urdu: - Automatic direction markers for LTR content in RTL context - Smart punctuation conversion for Arabic-script languages - Supports 27 languages total
*Testing* - 51.9% test coverage (actively improving) - Integration tests with mock AI providers - Format protection validation - Incremental diff logic tests