How to make Glade load translations from /opt

Solution 1:

I've found a solution: use the locale Python module instead of gettext

import locale
from locale import gettext as _
locale.bindtextdomain('qreator', '/opt/extras.ubuntu.com/qreator/share/locale/')
locale.textdomain('qreator')

Thanks to Juha Sahakangas on the #gtk+ IRC channel for providing the explanation:

For this particular case the locale module needs to be used instead of gettext. Python's gettext module is pure python, it doesn't actually set the text domain in a way that the C library can read, but locale does (by calling libc). So long as that's done, GtkBuilder already works the way you're asking it to.