From 2341c7083e25aa71e1e6b67d29fa61f38a9c3e35 Mon Sep 17 00:00:00 2001
From: Leigh Scott <leigh123linux@gmail.com>
Date: Tue, 30 Jan 2024 22:37:23 +0000
Subject: [PATCH] Fix python NameError: '_' is not defined
---
nemo-audio-tab/nemo-extension/nemo-audio-tab.py | 3 +++
nemo-compare/src/nemo-compare.py | 3 +++
nemo-emblems/nemo-extension/nemo-emblems.py | 3 +++
nemo-media-columns/nemo-media-columns.py | 3 +++
nemo-pastebin/src/nemo-pastebin.py | 3 +++
nemo-terminal/src/nemo_terminal.py | 4 ++++
6 files changed, 19 insertions(+)
diff --git a/nemo-audio-tab/nemo-extension/nemo-audio-tab.py b/nemo-audio-tab/nemo-extension/nemo-audio-tab.py
index 156e9d35..ac9c7d11 100644
--- a/nemo-audio-tab/nemo-extension/nemo-audio-tab.py
+++ b/nemo-audio-tab/nemo-extension/nemo-audio-tab.py
@@ -13,6 +13,9 @@
from mutagen.mp3 import MP3
from mutagen.flac import FLAC, StreamInfo
+# Import the gettext function and alias it as _
+from gettext import gettext as _
+
class AudioPropertyPage(GObject.GObject, Nemo.PropertyPageProvider, Nemo.NameAndDescProvider):
def get_property_pages(self, files):
diff --git a/nemo-compare/src/nemo-compare.py b/nemo-compare/src/nemo-compare.py
index dfd1704c..ff2cf10e 100644
--- a/nemo-compare/src/nemo-compare.py
+++ b/nemo-compare/src/nemo-compare.py
@@ -25,6 +25,9 @@
from gi.repository import GLib
signal.signal(signal.SIGINT, signal.SIG_DFL)
+# Import the gettext function and alias it as _
+from gettext import gettext as _
+
import gi
gi.require_version('Nemo', '3.0')
from gi.repository import Nemo, GObject, Gio
diff --git a/nemo-emblems/nemo-extension/nemo-emblems.py b/nemo-emblems/nemo-extension/nemo-emblems.py
index 80e64b34..2b2cc841 100644
--- a/nemo-emblems/nemo-extension/nemo-emblems.py
+++ b/nemo-emblems/nemo-extension/nemo-emblems.py
@@ -8,6 +8,9 @@
from gi.repository import Nemo
+# Import the gettext function and alias it as _
+from gettext import gettext as _
+
# i18n
APP = 'nemo-extensions'
LOCALE_DIR = "/usr/share/locale"
diff --git a/nemo-media-columns/nemo-media-columns.py b/nemo-media-columns/nemo-media-columns.py
index d62237ad..e113ea14 100644
--- a/nemo-media-columns/nemo-media-columns.py
+++ b/nemo-media-columns/nemo-media-columns.py
@@ -40,6 +40,9 @@
# for reading pdf
from PyPDF2 import PdfFileReader
+# Import the gettext function and alias it as _
+from gettext import gettext as _
+
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
diff --git a/nemo-pastebin/src/nemo-pastebin.py b/nemo-pastebin/src/nemo-pastebin.py
index 24c52dee..0440d332 100755
--- a/nemo-pastebin/src/nemo-pastebin.py
+++ b/nemo-pastebin/src/nemo-pastebin.py
@@ -37,6 +37,9 @@
gi.require_version('Nemo', '3.0')
from gi.repository import Nemo
+# Import the gettext function and alias it as _
+from gettext import gettext as _
+
try:
gi.require_version('Notify', '0.7')
from gi.repository import Notify
diff --git a/nemo-terminal/src/nemo_terminal.py b/nemo-terminal/src/nemo_terminal.py
index a32e0d99..568af961 100755
--- a/nemo-terminal/src/nemo_terminal.py
+++ b/nemo-terminal/src/nemo_terminal.py
@@ -47,6 +47,10 @@
import codecs
import gettext
+
+# Import the gettext function and alias it as _
+from gettext import gettext as _
+
gettext.bindtextdomain("nemo-extensions")
gettext.textdomain("nemo-extensions")
_ = gettext.gettext