The developer community is engaged in a heated discussion about software translation methods following the publication of SumatraPDF's custom internationalization approach. The popular PDF viewer, which supports 72 languages, chose to build its own translation system rather than use established solutions like GNU gettext or commercial services.
SumatraPDF Translation System Stats:
- 341 translatable strings
- 72 supported languages
- 35,440 total string translations collected
- 239 lines of C++ translation code
- 4,000 lines of Go server code for AppTranslator
The Custom Solution Controversy
SumatraPDF's developer created a complete translation ecosystem from scratch, including a web application called AppTranslator for crowdsourcing translations and custom C++ code for handling language switching. The system uses simple macros like _TRA() and _TRN() to mark translatable strings and processes them through a Go script. However, this approach has drawn significant criticism from experienced developers who argue that existing solutions would have been more appropriate.
The debate centers on whether reinventing established tools is justified. Critics point out that the custom solution lacks important features like plural form support and positional formatting, which are standard in mature translation frameworks. These features become crucial when dealing with languages that have complex grammar rules or different sentence structures.
Translation System Components:
_TRA()macro: Expands to translation function call_TRN()macro: Expands to English string for delayed translation- AppTranslator: Custom web app for crowdsourcing translations
- Go script: Extracts strings from source code using regex
- Linear search: Method for finding translations in C++ arrays
Missing Features and Technical Limitations
Several developers highlighted critical gaps in the custom approach. The system treats English strings as both display text and translation keys, which can cause problems when the same English word needs different translations depending on context. Additionally, the linear search method for finding translations, while simple, may not scale well for larger applications.
Internationalization and localization are extremely hard problems. I know because I worked as technical translator for some years.
The lack of plural form support is particularly problematic since different languages handle plurals in vastly different ways. Some languages have multiple plural forms, while others use entirely different grammatical structures that a simple string replacement cannot handle.
Alternative Solutions and Modern Approaches
Community members suggested several established alternatives that could have saved development time while providing better functionality. GNU gettext remains popular for its comprehensive feature set and extensive tooling support. Services like Weblate, Transifex, and translatewiki.net offer web-based translation management with built-in collaboration features and expert support.
For Windows-specific applications, some developers recommended using Microsoft's Multilingual User Interface (MUI) system, which provides native platform integration and broad tooling support. Others suggested Qt's translation system for cross-platform applications.
An interesting modern approach emerged from the discussion: using AI language models for initial translations. While this sparked its own debate about translation quality, some developers reported success using AI for basic UI elements, though they acknowledged that human review remains essential for quality localization.
Alternative Translation Solutions Mentioned:
- GNU gettext: Uses .po files, includes xgettext extraction tool
- Weblate: Open-source web-based translation platform
- Transifex: Commercial translation service
- translatewiki.net: Community translation platform for open source
- Microsoft MUI: Native Windows multilingual interface system
- Qt Translation System: Cross-platform solution with comprehensive tooling
The Broader Development Philosophy
The controversy reflects a deeper philosophical divide in software development between building custom solutions versus adopting existing tools. While SumatraPDF's approach demonstrates impressive engineering skills and provides complete control over the translation process, critics argue that it represents unnecessary complexity for a solved problem.
The discussion also highlighted the importance of understanding problem scope before choosing solutions. What might seem like a simple translation task can quickly become complex when dealing with multiple languages, cultural contexts, and accessibility requirements. The community consensus suggests that while custom solutions have their place, established tools often provide better long-term value for common problems like internationalization.
Reference: Implementing UI translation in SumatraPDF, a C++ Windows application
