From e10df9eb6d8e16e7b55f4f07ab5008cb9bbe7e87 Mon Sep 17 00:00:00 2001 From: prculley Date: Sat, 31 Aug 2019 09:26:32 -0500 Subject: [PATCH] Fix missing menus/buttons when operating in non-English languages Fixes #11292 --- gramps/gui/uimanager.py | 13 +++++++++++-- gramps/gui/views/tags.py | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gramps/gui/uimanager.py b/gramps/gui/uimanager.py index 4f2331814..dd870ce33 100644 --- a/gramps/gui/uimanager.py +++ b/gramps/gui/uimanager.py @@ -213,8 +213,17 @@ class UIManager(): # need to copy the tree so we can preserve original for later edits. editable = copy.deepcopy(self.et_xml) iterator(editable) # clean up tree to builder specifications - xml_str = ET.tostring(editable, encoding="unicode") - #print(xml_str) + # The following should work, but seems to have a Gtk bug + # xml_str = ET.tostring(editable, encoding="unicode") + + xml_str = ET.tostring(editable).decode(encoding='ascii') + + # debugging + # with open('try.xml', 'w', encoding='utf8') as file: + # file.write(xml_str) + # with open('try.xml', encoding='utf8') as file: + # xml_str = file.read() + # print(xml_str) self.builder = Gtk.Builder() self.builder.set_translation_domain(glocale.get_localedomain()) self.builder.add_from_string(xml_str) diff --git a/gramps/gui/views/tags.py b/gramps/gui/views/tags.py index cab4332fc..ad0d9071d 100644 --- a/gramps/gui/views/tags.py +++ b/gramps/gui/views/tags.py @@ -246,8 +246,8 @@ class Tags(DbGUIElement): ''' for tag_name, handle in self.__tag_list: - tag_menu += menuitem % (handle, tag_name) - actions.append(('TAG_%s' % handle, + tag_menu += menuitem % (handle, escape(tag_name)) + actions.append(('TAG-%s' % handle, make_callback(self.tag_selected_rows, handle))) tag_menu = TAG_MENU % tag_menu