From 14c2ac695983620e0c181f0775ac3d8815732902 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Fri, 6 Aug 2021 14:49:16 -0400 Subject: [PATCH] po: make common button names translatable and show translations --- lib/logitech_receiver/i18n.py | 20 ++++++++++++++++++++ lib/solaar/ui/config_panel.py | 6 +++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lib/logitech_receiver/i18n.py b/lib/logitech_receiver/i18n.py index 1b4025cd..3a35c125 100644 --- a/lib/logitech_receiver/i18n.py +++ b/lib/logitech_receiver/i18n.py @@ -68,4 +68,24 @@ _DUMMY = ( _('Bootloader'), _('Hardware'), _('Other'), + + # common button and task names (from special_keys.py) + _('Left Button'), + _('Right Button'), + _('Middle Button'), + _('Back Button'), + _('Forward Button'), + _('Mouse Gesture Button'), + _('Smart Shift'), + _('DPI Switch'), + _('Left Tilt'), + _('Right Tilt'), + _('Left Click'), + _('Right Click'), + _('Mouse Middle Button'), + _('Mouse Back Button'), + _('Mouse Forward Button'), + _('Gesture Button Navigation'), + _('Mouse Scroll Left Button'), + _('Mouse Scroll Right Button'), ) diff --git a/lib/solaar/ui/config_panel.py b/lib/solaar/ui/config_panel.py index 79df06ec..aaf4fb73 100644 --- a/lib/solaar/ui/config_panel.py +++ b/lib/solaar/ui/config_panel.py @@ -105,7 +105,7 @@ def _create_choice_control(setting): c = Gtk.ComboBoxText() # TODO i18n text entries for entry in setting.choices: - c.append(str(int(entry)), str(entry)) + c.append(str(int(entry)), _(str(entry))) c.connect('changed', _combo_notify, setting) return c @@ -133,7 +133,7 @@ def _create_map_choice_control(setting): if choices: # TODO i18n text entries for choice in choices: - valueBox.append(str(int(choice)), str(choice)) + valueBox.append(str(int(choice)), _(str(choice))) if current is not None: valueBox.set_active_id(str(int(current))) @@ -144,7 +144,7 @@ def _create_map_choice_control(setting): c.pack_end(valueBox, False, False, 0) # TODO i18n text entries for entry in setting.choices: - keyBox.append(str(int(entry)), str(entry)) + keyBox.append(str(int(entry)), _(str(entry))) keyBox.set_active(0) keyBox.connect('changed', _map_value_notify_key, (setting, valueBox)) _map_populate_value_box(valueBox, setting, int(keyBox.get_active_id()))