[gedit-plugins/translate] Fixes
- From: Jordi Mas <jmas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-plugins/translate] Fixes
- Date: Fri, 21 Jul 2017 15:14:42 +0000 (UTC)
commit 2d533453e9c7859fa42471f6ef851c7910e05239
Author: Jordi Mas <jmas softcatala org>
Date: Fri Jul 21 17:14:31 2017 +0200
Fixes
plugins/translate/translate/preferences.py | 6 +++---
plugins/translate/translate/services/services.py | 8 +++++---
2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/plugins/translate/translate/preferences.py b/plugins/translate/translate/preferences.py
index 546322f..8247441 100644
--- a/plugins/translate/translate/preferences.py
+++ b/plugins/translate/translate/preferences.py
@@ -60,7 +60,7 @@ class Preferences(object):
else:
self._apikey = None
return
-
+
self._apikey.connect('changed', self._changed_apikey)
key = self._settings.get_string(self.API_KEY)
self._apikey.set_text(key)
@@ -81,7 +81,7 @@ class Preferences(object):
apibox.remove(self._apikey)
self._apilabel = None
self._apikey = None
-
+
def _init_radiobuttons(self):
self._radio_samedoc = self._ui.get_object('same_document')
self._output_window = self._ui.get_object('output_window')
@@ -109,7 +109,7 @@ class Preferences(object):
service_id = self._settings.get_uint(self.SERVICE)
self._services.set_active(service_id)
self._services.connect('changed', self._changed_services)
-
+
def _init_combobox_languages(self):
self._languages = self._ui.get_object('languages')
diff --git a/plugins/translate/translate/services/services.py
b/plugins/translate/translate/services/services.py
index 57f99c2..8ac4f5f 100644
--- a/plugins/translate/translate/services/services.py
+++ b/plugins/translate/translate/services/services.py
@@ -23,7 +23,9 @@ from .yandex import Yandex
class Services():
- SERVICES = {0: "Apertium", 1: "Yandex"}
+ APERTIUM_ID = 0
+ YANDEX_ID = 1
+ SERVICES = {APERTIUM_ID: "Apertium", YANDEX_ID: "Yandex"}
@staticmethod
def get_name(service_id):
@@ -32,9 +34,9 @@ class Services():
@staticmethod
def get(service_id):
print(service_id)
- if service_id == 0:
+ if service_id == Services.APERTIUM_ID:
return Apertium()
- elif service_id == 1:
+ elif service_id == Services.YANDEX_ID:
return Yandex()
@staticmethod
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]