▲ | Implementing UI translation in SumatraPDF, a C++ Windows application(blog.kowalczyk.info) | |||||||||||||||||||||||||
54 points by jandeboevrie 10 hours ago | 16 comments | ||||||||||||||||||||||||||
▲ | nerdile 11 minutes ago | parent | next [-] | |||||||||||||||||||||||||
Since this is a Windows C++ app, why not use MUI? It solves this exact problem, and since it's a standard part of the platform, there's broad tooling support for it. | ||||||||||||||||||||||||||
▲ | Kwpolska 7 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
> [gettext] also doesn’t solve the 2 hard problems. I would still have to write code to extract strings from source code and build a way to allow users to translate them easily. 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. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | bramblerose 7 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
The solution to the "interface/tooling to translate" problem, at least for open source applications, is https://translatewiki.net/ , with the additional benefit that it comes with a team of experts that can help you understand how to deal with stuff you might be unfamiliar with, such as RTL languages and plural forms. | ||||||||||||||||||||||||||
▲ | cyco130 5 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
Internationalization and localization are extremely hard problems. I know because I worked as technical translator for sone years. 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. | ||||||||||||||||||||||||||
▲ | NooneAtAll3 8 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
Looking at strings in the linked apptranslator.org website, a lot of them have ampersands (&) e.g. "&Back" or "&Book View" 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? | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | rikafurude21 7 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
I had to implement multilingual UI for my app recently and the best method I found was using an LLM API inside a script which just runs on build and anytime a new text field gets added it gets the translations and stores it in a JSON where the right strings are picked based on system language or user settings. The annoying part was adjusting the entire UI to the new 'dynamic' string selection functionality but other than that, the tokens I had generated only cost maybe a dollar. I suggest the author looks into that, because waiting for user submissions could take some time | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | on_the_train 9 hours ago | parent | prev [-] | |||||||||||||||||||||||||
I'm also trying to avoid the gettext monstrosity to be introduced into our c++ codebase after making equality great experiences with a self-build solution in previous teams. It's ok so solve easy problems by yourself. Good for the author for thinking for himself. | ||||||||||||||||||||||||||
|