I have a small python program that shows how to do translations of GTK (pygobject) GUIs for Linux and Windows. Everything works in Linux, but in Windows non-ASCII symbols are not rendered in the translation.
I assume that the both the Glade file and the *.mo file are decoded correctly because:
- The English interface shows non-ASCII symbols fine
- Both English and the translations show non-ASCII characters in print-statements
Here is what the interface looks like in the English original:
And the German translation using no environment variable or PANGOCAIRO_BACKEND=win32
:
The German translation using the environment variable PANGOCAIRO_BACKEND=fontconfig
(PANGOCAIRO_BACKEND=fc
). The first label is set to use Calibri using Pango. And that is certainly a font that has "ö", "ä" and "ü" on Windows.
In the console this warning appears for the translation: Pango-Warning **: Invalid UTF-8 string passed to pango_layout_set_text()
.
Some details about getting the translations to work were already discussed here:
The repository:
The installer for Windows:
Is it possible that builder.set_translation_domain("pygibank")
pushes the translations with the wrong encoding? Is it possible to debug this or does anyone know how to fix this?