Update tag.py

- translation for menu strings added
- escape illegal characters in tag_name
This commit is contained in:
Mattkmmr 2020-01-14 19:38:51 +01:00 committed by Paul Culley
parent dd63d479cd
commit cc7c0a3f13

View File

@ -247,12 +247,12 @@ class Tags(DbGUIElement):
for tag_name, handle in self.__tag_list: for tag_name, handle in self.__tag_list:
tag_menu += menuitem % ("TAG-%s" % handle, tag_menu += menuitem % ("TAG-%s" % handle,
"Add tag '%s'" % tag_name) _("Add tag '%s'") % escape(tag_name))
actions.append(('TAG-%s' % handle, actions.append(('TAG-%s' % handle,
make_callback(self.tag_selected_rows, handle))) make_callback(self.tag_selected_rows, handle)))
for tag_name, handle in self.__tag_list: for tag_name, handle in self.__tag_list:
tag_menu += menuitem % ("R-TAG-%s" % handle, tag_menu += menuitem % ("R-TAG-%s" % handle,
"Remove tag '%s'" % tag_name) _("Remove tag '%s'") % escape(tag_name))
actions.append(('R-TAG-%s' % handle, actions.append(('R-TAG-%s' % handle,
make_callback(self.remove_tag_selected_rows, make_callback(self.remove_tag_selected_rows,
handle))) handle)))
@ -332,7 +332,7 @@ class Tags(DbGUIElement):
# database transaction while the one setting tags is still running. # database transaction while the one setting tags is still running.
pmon = progressdlg.ProgressMonitor(progressdlg.GtkProgressDialog, pmon = progressdlg.ProgressMonitor(progressdlg.GtkProgressDialog,
("", self.uistate.window, Gtk.DialogFlags.MODAL), popup_time=2) ("", self.uistate.window, Gtk.DialogFlags.MODAL), popup_time=2)
status = progressdlg.LongOpStatus(msg=_("Adding Tags"), status = progressdlg.LongOpStatus(msg=_("Removing Tags"),
total_steps=len(selected), total_steps=len(selected),
interval=len(selected)//20) interval=len(selected)//20)
pmon.add_op(status) pmon.add_op(status)