Infuriating #GTK discovery of the day: There is seemingly no way to load gettext `.mo` files from a GResource, and no way to overwrite the common `_("Hello there")` syntax to resolve to a custom function with a different i18n library
We don't control gettext, unfortunately; that's all GNU libc. Believe me: we'd love to have a better localisation infrastructure, but nobody is working on that particular chestnut.
@ebassi Makes total sense. Do you happen to know another way of resolving a translatable=true string to the intended value? In Go I provide a template function overwrite in HTML called GetTranslation, but in GTK I can't find a similar way to overwrite it ...
Emmanuele Bassi
in reply to Felicitas Pojtinger 🌅 • • •Felicitas Pojtinger 🌅
in reply to Emmanuele Bassi • • •Emmanuele Bassi
in reply to Felicitas Pojtinger 🌅 • • •I've seen Python people extract the strings straight from the XML, like this: github.com/gaphor/gaphor/blob/…
That would work if you keep the UI definition in the GResource and you have another way to map it to a translated equivalent.
gaphor/gaphor/i18n.py at main · gaphor/gaphor
GitHub