Fix Dashboard for adding Gramplet crash in Slovenian (#978)

Fixes #11491
This commit is contained in:
Paul Culley 2020-01-09 11:34:15 -06:00 committed by GitHub
parent 09e89549de
commit 1a8406e2e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1473,7 +1473,7 @@ class GrampletPane(Gtk.ScrolledWindow):
plugs.sort(key=lambda x: x.name) plugs.sort(key=lambda x: x.name)
for plug in plugs: for plug in plugs:
action_name = valid_action_name(plug.id) action_name = valid_action_name(plug.id)
a_menuitems += menuitem % (action_name, plug.name) a_menuitems += menuitem % (action_name, escape(plug.name))
actions.append((action_name, actions.append((action_name,
make_callback(self.add_gramplet, plug.name))) make_callback(self.add_gramplet, plug.name)))
names = [gramplet.title for gramplet in self.closed_gramplets] names = [gramplet.title for gramplet in self.closed_gramplets]
@ -1484,7 +1484,7 @@ class GrampletPane(Gtk.ScrolledWindow):
# 'name' could be non-ASCII when in non-English language # 'name' could be non-ASCII when in non-English language
# action names must be in ASCII, so use 'id' instead. # action names must be in ASCII, so use 'id' instead.
action_name = valid_action_name(str(id(name))) action_name = valid_action_name(str(id(name)))
r_menuitems += menuitem % (action_name, name) r_menuitems += menuitem % (action_name, escape(name))
actions.append((action_name, actions.append((action_name,
make_callback(self.restore_gramplet, make_callback(self.restore_gramplet,
name))) name)))