Commit cbe1cf46 authored by Kai Willadsen's avatar Kai Willadsen

meldapp: Monkey-patch optparse's gettext alias for ugettext compat

Meld uses and assumes ugettext for our translations, and this doesn't
interact well with optparse's use of gettext, when it tries to mash
together its bytestring translations with our unicode translations.

While this is an ugly hack, the only other simple option is not using
optparse, which is a longer-term goal but much too invasive for a
quick fix.
parent 59c9e157
......@@ -34,6 +34,12 @@ from meld.conf import _
log = logging.getLogger(__name__)
# Monkeypatching optparse like this is obviously awful, but this is to
# handle Unicode translated strings within optparse itself that will
# otherwise crash badly. This just makes optparse use our ugettext
# import of _, rather than the non-unicode gettext.
optparse._ = _
class MeldApp(Gtk.Application):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment