[gedit-plugins/translate] Use ID provided by callback
- From: Jordi Mas <jmas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-plugins/translate] Use ID provided by callback
- Date: Sat, 10 Mar 2018 05:52:27 +0000 (UTC)
commit 002a8d929c6105df7a81824dcd59bb5fdf59ef9a
Author: Jordi Mas <jmas softcatala org>
Date: Sat Mar 10 06:52:15 2018 +0100
Use ID provided by callback
plugins/translate/translate/__init__.py | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/plugins/translate/translate/__init__.py b/plugins/translate/translate/__init__.py
index 57bd51b..066e1c9 100644
--- a/plugins/translate/translate/__init__.py
+++ b/plugins/translate/translate/__init__.py
@@ -91,9 +91,8 @@ class TranslateWindowActivatable(GObject.Object, Gedit.WindowActivatable, PeasGt
service_id = settings.get_service()
return Services.get_name(service_id)
- def _get_translation_service(self):
+ def _get_translation_service(self, service_id):
settings = Settings()
- service_id = settings.get_service()
service = Services.get(service_id)
if service.has_api_key() is True:
key = settings.get_apikey()
@@ -103,7 +102,7 @@ class TranslateWindowActivatable(GObject.Object, Gedit.WindowActivatable, PeasGt
return service
def get_languages_names_codes(self, service_id):
- service = self._get_translation_service()
+ service = self._get_translation_service(service_id)
return service.get_language_names(), service.get_language_codes()
def do_create_configure_widget(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]