[gedit-plugins] Make API Key localizable and fix showing localised api_hint text
- From: Jordi Mas <jmas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-plugins] Make API Key localizable and fix showing localised api_hint text
- Date: Wed, 7 Mar 2018 17:28:54 +0000 (UTC)
commit 48563cf7115a1697226ca5ec111fa4262768113b
Author: Jordi Mas <jmas softcatala org>
Date: Wed Mar 7 18:26:38 2018 +0100
Make API Key localizable and fix showing localised api_hint text
plugins/translate/translate/preferences.py | 9 ++++++++-
plugins/translate/translate/services/service.py | 8 --------
plugins/translate/translate/services/yandex.py | 9 +++++++++
po/POTFILES.in | 3 ++-
4 files changed, 19 insertions(+), 10 deletions(-)
---
diff --git a/plugins/translate/translate/preferences.py b/plugins/translate/translate/preferences.py
index 9b3096b..e40fd98 100644
--- a/plugins/translate/translate/preferences.py
+++ b/plugins/translate/translate/preferences.py
@@ -24,6 +24,13 @@ from gpdefs import *
from .services.services import Services
from .settings import Settings
+try:
+ import gettext
+ gettext.bindtextdomain('gedit-plugins')
+ gettext.textdomain('gedit-plugins')
+ _ = gettext.gettext
+except:
+ _ = lambda s: s
class Preferences(object):
@@ -75,7 +82,7 @@ class Preferences(object):
if show is True:
service = Services.get(self._service_id)
- self._apilabel = Gtk.Label("API Key")
+ self._apilabel = Gtk.Label(_("API Key"))
self._apikey = Gtk.Entry(expand=True)
self._apikey.connect('changed', self._changed_apikey)
key = self._settings.get_apikey()
diff --git a/plugins/translate/translate/services/service.py b/plugins/translate/translate/services/service.py
index b9769af..5406c6e 100644
--- a/plugins/translate/translate/services/service.py
+++ b/plugins/translate/translate/services/service.py
@@ -19,14 +19,6 @@
from abc import ABCMeta, abstractmethod
-try:
- import gettext
- gettext.bindtextdomain('gedit-plugins')
- gettext.textdomain('gedit-plugins')
- _ = gettext.gettext
-except:
- _ = lambda s: s
-
class Service(metaclass=ABCMeta):
@abstractmethod
diff --git a/plugins/translate/translate/services/yandex.py b/plugins/translate/translate/services/yandex.py
index 1cd08ab..c907f35 100644
--- a/plugins/translate/translate/services/yandex.py
+++ b/plugins/translate/translate/services/yandex.py
@@ -21,6 +21,15 @@ import urllib.request, urllib.parse, urllib.error
import json
from .service import Service
+try:
+ import gettext
+ gettext.bindtextdomain('gedit-plugins')
+ gettext.textdomain('gedit-plugins')
+ _ = gettext.gettext
+except:
+ _ = lambda s: s
+
+
class Yandex(Service):
g_language_codes = []
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 169c2e5..6f33296 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -59,8 +59,9 @@ plugins/textsize/textsize.plugin.desktop.in.in
plugins/translate/gedit-translate.metainfo.xml.in
plugins/translate/org.gnome.gedit.plugins.translate.gschema.xml
plugins/translate/translate/__init__.py
-plugins/translate/translate/services/yandex.py
plugins/translate/translate.plugin.desktop.in.in
+plugins/translate/translate/preferences.py
+plugins/translate/translate/services/yandex.py
[type: gettext/glade]plugins/translate/translate/ui/preferences.ui
[type: gettext/glade]plugins/wordcompletion/gedit-word-completion-configure.ui
plugins/wordcompletion/gedit-wordcompletion.metainfo.xml.in
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]