Implementing UI Translation in Sumatrapdf, a C++ Windows Application
Key topics
The author discusses implementing UI translation in SumatraPDF, a C++ Windows application, and shares their experience with a custom solution, sparking a discussion on the best approaches to internationalization and localization.
Snapshot generated from the HN discussion
Discussion Activity
Active discussionFirst comment
36m
Peak period
13
0-6h
Avg / period
5
Based on 25 loaded comments
Key moments
- 01Story posted
Sep 25, 2025 at 3:17 PM EDT
3 months ago
Step 01 - 02First comment
Sep 25, 2025 at 3:53 PM EDT
36m after posting
Step 02 - 03Peak activity
13 comments in 0-6h
Hottest window of the conversation
Step 03 - 04Latest activity
Sep 29, 2025 at 7:48 AM EDT
3 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
Compared to gettext, OP's solution doesn't have positional formatting or support for additional plural forms.
What do those mean?
Translations seem to put them in the middle sometimes
---
on the other hand, there are languages even with "0 untranslated strings" that have untranslated "unused strings" - what are those about, and is it okay to not have those be tracked?
https://willus.com/mingw/colinp/win32/resources/menu.html
(This idea is nice but not without its problems. For those of us who regularly use more than one keyboard layout or even system locale, it doesn’t work all that well.)
The first problem is solved by the xgettext tool.
The second problem is solved by services like Transifex. Or by telling people to use Poedit and having them submit GitHub pull requests.
At the same time, gettext does solve the issue of plural forms. This solution does not.
Just wanted to mention another of those services, that I discovered by contributing translation work for the jellyfin project:
https://weblate.org/
The jellyfin status can be seen here:
https://translate.jellyfin.org/projects/jellyfin/
https://poedit.net
But, in C++ land, I had very good success with Qt and its translation system in one of my open source projects.
That was 2010’ish, there are probably better ways now bit I don’t know.
Just translating literally does not always work.
I am building an Android application and facing this issue. I've been thinking about going down the rabbit hole and linking each text to be translated to a screenshot or similar thing, so that the user sees their proposed translation in context