Reducing the Localisation Burden: Streamlining PO File Translation with Context-Aware LLMs
Note: This is an updated and expanded version of my previous talk from DDD Athens 2026, incorporating new features and capabilities.
Manually translating the UI text is important, yet arduous work. While the translation capability of LLMs is outstanding, there is no guarantee that they translate new strings consistently with the existing ones. For instance, it may translate 'Machine name' as 'Machinale naam' instead of the established translation 'Systeemnaam'.
The RAG-LLM Translator solves this issue by utilising existing translation strings as translation memory. The architecture allows users to supply a glossary, or generate one from existing translations.
The infrastructure is provider-agnostic, supporting both external APIs and locally deployed models. The tool also comes with various features such as a post-processing framework, a RAG tuning helper and LLM-as-a-Judge among other builtin utilities.
A baseline version of this topic was previously presented at Drupal Developer Days Athens 2026. Since that presentation, the application has undergone comprehensive architectural refactoring and a series of major functional enhancements.
The latest version of the system introduces the following technical updates and features:
- Interactive CLI Management: A guided system menu to manage the entire configuration, ingestion, and execution lifecycle.
- Multi-Language Processing: The capability to process and translate multiple target languages concurrently within a single execution block.
- Gettext Context (
msgctxt) Support: Native handling of gettext context flags to ensure precise translation of identical source strings with differing semantic meanings. - Multi-Provider Integration: Broadened LLM provider and reasoning model support managed via a unified, local LiteLLM gateway.
- Token Tracking: Implementation of an internal token counter to monitor API usage.
- Vector Database Administration UI: A dedicated administrative interface to inspect collections, view metadata, and debug embedding similarity matching visually.
- Expanded Test Coverage: Introduction of automated testing frameworks for the orchestration shell scripts alongside the existing Python test suites.
Based in Utrecht, the Netherlands, I am a freelance engineer and project/product manager. With over two decades of extensive experience in Drupal, I have supported a diverse range of clients across Europe, Japan, and the US.
d.o username: dokumori