[gnome-builder] python: use Ide.gettext() for gettext
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] python: use Ide.gettext() for gettext
- Date: Tue, 11 Oct 2016 22:29:16 +0000 (UTC)
commit f66338a53051b32f315319f0c0b6ef9b18594378
Author: Christian Hergert <chergert redhat com>
Date: Tue Oct 11 15:28:49 2016 -0700
python: use Ide.gettext() for gettext
This uses our proper translation domain for all our use of
gettext in python plugins.
.../contributing/contributing_plugin/__init__.py | 3 ++-
plugins/contributing/contributing_plugin/helper.py | 3 ++-
plugins/fpaste/fpaste_plugin/__init__.py | 4 ++--
.../html-preview/html_preview_plugin/__init__.py | 4 ++--
plugins/jedi/jedi_plugin.py | 3 ++-
plugins/todo/todo_plugin/__init__.py | 4 +++-
6 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/plugins/contributing/contributing_plugin/__init__.py
b/plugins/contributing/contributing_plugin/__init__.py
index 4f4ee01..e80d0f7 100644
--- a/plugins/contributing/contributing_plugin/__init__.py
+++ b/plugins/contributing/contributing_plugin/__init__.py
@@ -22,7 +22,6 @@
import gi
from getopt import getopt, GetoptError
import getpass
-from gettext import gettext as _
import os
import sys
import time
@@ -37,6 +36,8 @@ from gi.repository import Gio
from gi.repository import Ggit
from gi.repository import Ide
+_ = Ide.gettext
+
class ContributeTool(helper.PyApplicationTool):
location = None
diff --git a/plugins/contributing/contributing_plugin/helper.py
b/plugins/contributing/contributing_plugin/helper.py
index 5592999..8d6692f 100644
--- a/plugins/contributing/contributing_plugin/helper.py
+++ b/plugins/contributing/contributing_plugin/helper.py
@@ -23,7 +23,6 @@ import gi
gi.require_version('Ide', '1.0')
from getopt import getopt, GetoptError
-from gettext import gettext as _
import shutil
import sys
@@ -31,6 +30,8 @@ from gi.repository import GObject
from gi.repository import Gio
from gi.repository import Ide
+_ = Ide.gettext
+
class PyApplicationTool(GObject.Object, Ide.ApplicationTool):
# Leftover args during parsing
args = None
diff --git a/plugins/fpaste/fpaste_plugin/__init__.py b/plugins/fpaste/fpaste_plugin/__init__.py
index 7620b16..e41cb2c 100644
--- a/plugins/fpaste/fpaste_plugin/__init__.py
+++ b/plugins/fpaste/fpaste_plugin/__init__.py
@@ -19,8 +19,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-from gettext import gettext as _
-
import gi
gi.require_version('Gdk', '3.0')
@@ -39,6 +37,8 @@ import threading
import urllib.parse
import urllib.request
+_ = Ide.gettext
+
USER_AGENT = 'gnome-builder-fpaste/0.1'
BASE_URL = 'https://paste.fedoraproject.org'
diff --git a/plugins/html-preview/html_preview_plugin/__init__.py
b/plugins/html-preview/html_preview_plugin/__init__.py
index 673eda3..e9ad2f2 100644
--- a/plugins/html-preview/html_preview_plugin/__init__.py
+++ b/plugins/html-preview/html_preview_plugin/__init__.py
@@ -19,8 +19,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-from gettext import gettext as _
-
import gi
import os
@@ -36,6 +34,8 @@ from gi.repository import Ide
from gi.repository import WebKit2
from gi.repository import Peas
+_ = Ide.gettext
+
class HtmlPreviewData(GObject.Object, Ide.ApplicationAddin):
MARKDOWN_CSS = None
MARKED_JS = None
diff --git a/plugins/jedi/jedi_plugin.py b/plugins/jedi/jedi_plugin.py
index 44cf196..7be46f2 100644
--- a/plugins/jedi/jedi_plugin.py
+++ b/plugins/jedi/jedi_plugin.py
@@ -41,7 +41,6 @@ gi.require_version('GtkSource', '3.0')
gi.require_version('Ide', '1.0')
from collections import OrderedDict
-from gettext import gettext as _
from gi.importer import DynamicImporter
from gi.module import IntrospectionModule
@@ -57,6 +56,8 @@ from gi.repository import Ide
from gi.types import GObjectMeta
from gi.types import StructMeta
+_ = Ide.gettext
+
gi_importer = DynamicImporter('gi.repository')
_TYPE_KEYWORD = 1
diff --git a/plugins/todo/todo_plugin/__init__.py b/plugins/todo/todo_plugin/__init__.py
index 7f2530a..be6c3bc 100644
--- a/plugins/todo/todo_plugin/__init__.py
+++ b/plugins/todo/todo_plugin/__init__.py
@@ -18,6 +18,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+
import gi
gi.require_version('Ide', '1.0')
@@ -29,11 +30,12 @@ from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import Pnl
-from gettext import gettext as _
import re
import subprocess
import threading
+_ = Ide.gettext
+
LINE1 = re.compile('(.*):(\d+):(.*)')
LINE2 = re.compile('(.*)-(\d+)-(.*)')
KEYWORDS = ['FIXME:', 'XXX:', 'TODO:']
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]