Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix translation in popup menu #926

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions terminatorlib/terminal_popup_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def menu_item(self, menutype, actstr, menustr):

dbg("action from config:%s for item:%s with shortcut accelchar:(%s)"
% (maskstr, menustr, accelchar))
item = menutype.new_with_mnemonic(_(menustr))
item = menutype.new_with_mnemonic(menustr)
if mask:
item.add_accelerator("activate",
self.accelgrp,
Expand Down Expand Up @@ -155,26 +155,26 @@ def show(self, widget, event=None):

menu.append(Gtk.SeparatorMenuItem())

item = self.menu_item(Gtk.ImageMenuItem, 'copy', '_Copy')
item = self.menu_item(Gtk.ImageMenuItem, 'copy', _('_Copy'))
item.connect('activate', lambda x: terminal.vte.copy_clipboard())
item.set_sensitive(terminal.vte.get_has_selection())

menu.append(item)

item = self.menu_item(Gtk.ImageMenuItem, 'paste', '_Paste')
item = self.menu_item(Gtk.ImageMenuItem, 'paste', _('_Paste'))
item.connect('activate', lambda x: terminal.paste_clipboard())
menu.append(item)

menu.append(Gtk.SeparatorMenuItem())

item = self.menu_item(Gtk.ImageMenuItem, 'edit_window_title',
'Set _Window Title')
_('Set _Window Title'))
item.connect('activate', lambda x: terminal.key_edit_window_title())
menu.append(item)

if not terminal.is_zoomed():
item = self.menu_item(Gtk.ImageMenuItem, 'split_auto',
'Split _Auto')
_('Split _Auto'))
"""
image = Gtk.Image()
image.set_from_icon_name(APP_NAME + '_auto', Gtk.IconSize.MENU)
Expand All @@ -188,7 +188,7 @@ def show(self, widget, event=None):


item = self.menu_item(Gtk.ImageMenuItem, 'split_horiz',
'Split H_orizontally')
_('Split H_orizontally'))
image = Gtk.Image()
image.set_from_icon_name(APP_NAME + '_horiz', Gtk.IconSize.MENU)
item.set_image(image)
Expand All @@ -199,7 +199,7 @@ def show(self, widget, event=None):
menu.append(item)

item = self.menu_item(Gtk.ImageMenuItem, 'split_vert',
'Split V_ertically')
_('Split V_ertically'))
image = Gtk.Image()
image.set_from_icon_name(APP_NAME + '_vert', Gtk.IconSize.MENU)
item.set_image(image)
Expand All @@ -209,7 +209,7 @@ def show(self, widget, event=None):
self.terminal.get_cwd()))
menu.append(item)

item = self.menu_item(Gtk.MenuItem, 'new_tab', 'Open _Tab')
item = self.menu_item(Gtk.MenuItem, 'new_tab', _('Open _Tab'))
item.connect('activate', lambda x: terminal.emit('tab-new', False,
terminal))
menu.append(item)
Expand All @@ -222,7 +222,7 @@ def show(self, widget, event=None):

menu.append(Gtk.SeparatorMenuItem())

item = self.menu_item(Gtk.ImageMenuItem, 'close_term', '_Close')
item = self.menu_item(Gtk.ImageMenuItem, 'close_term', _('_Close'))
item.connect('activate', lambda x: terminal.close())
menu.append(item)

Expand Down Expand Up @@ -263,20 +263,20 @@ def show(self, widget, event=None):
menu.append(item)
menu.append(Gtk.SeparatorMenuItem())

item = self.menu_item(Gtk.CheckMenuItem, 'toggle_readonly', '_Read only')
item = self.menu_item(Gtk.CheckMenuItem, 'toggle_readonly', _('_Read only'))
item.set_active(not(terminal.vte.get_input_enabled()))
item.connect('toggled', lambda x: terminal.do_readonly_toggle())
menu.append(item)

item = self.menu_item(Gtk.CheckMenuItem, 'toggle_scrollbar',
'Show _scrollbar')
_('Show _scrollbar'))
item.set_active(terminal.scrollbar.get_property('visible'))
item.connect('toggled', lambda x: terminal.do_scrollbar_toggle())
menu.append(item)

if hasattr(Gtk, 'Builder'): # VERIFY FOR GTK3: is this ever false?
item = self.menu_item(Gtk.MenuItem, 'preferences',
'_Preferences')
_('_Preferences'))
item.connect('activate', lambda x: PrefsEditor(self.terminal))
menu.append(item)

Expand Down Expand Up @@ -327,7 +327,7 @@ def show(self, widget, event=None):

def add_layout_launcher(self, menu):
"""Add the layout list to the menu"""
item = self.menu_item(Gtk.MenuItem, 'layout_launcher', '_Layouts...')
item = self.menu_item(Gtk.MenuItem, 'layout_launcher', _('_Layouts...'))
menu.append(item)
submenu = Gtk.Menu()
item.set_submenu(submenu)
Expand Down
Loading