Windows: Fix translation

Fixes #9324
This commit is contained in:
Philipp Hörist 2018-09-08 08:40:42 +02:00 committed by Philipp Hörist
parent ba8d20ab78
commit 16712645a2
3 changed files with 10 additions and 4 deletions

View File

@ -182,8 +182,8 @@ class GajimApplication(Gtk.Application):
# Set Application Menu
app.app = self
from gajim import gtkgui_helpers
builder = gtkgui_helpers.get_gtk_builder('application_menu.ui')
from gajim.gtk.util import get_builder
builder = get_builder('application_menu.ui')
menubar = builder.get_object("menubar")
appmenu = builder.get_object("appmenu")
if app.prefers_app_menu():

View File

@ -68,7 +68,10 @@ def get_builder(file_name, widget=None):
if widget is not None:
builder.add_objects_from_string(xml_text, [widget])
else:
builder.add_from_string(xml_text)
# Workaround
# https://gitlab.gnome.org/GNOME/pygobject/issues/255
Gtk.Builder.__mro__[1].add_from_string(
builder, xml_text, len(xml_text.encode("utf-8")))
else:
if widget is not None:
builder.add_objects_from_file(file_path, [widget])

View File

@ -140,7 +140,10 @@ def get_gtk_builder(file_name, widget=None):
if widget is not None:
builder.add_objects_from_string(xml_text, [widget])
else:
builder.add_from_string(xml_text)
# Workaround
# https://gitlab.gnome.org/GNOME/pygobject/issues/255
Gtk.Builder.__mro__[1].add_from_string(
builder, xml_text, len(xml_text.encode("utf-8")))
else:
if widget is not None:
builder.add_objects_from_file(file_path, [widget])