Skip to content

Commit c1823b6

Browse files
Fix python NameError: '_' is not defined (#514)
1 parent 536abab commit c1823b6

6 files changed

Lines changed: 19 additions & 0 deletions

File tree

nemo-audio-tab/nemo-extension/nemo-audio-tab.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
from mutagen.mp3 import MP3
1414
from mutagen.flac import FLAC, StreamInfo
1515

16+
# Import the gettext function and alias it as _
17+
from gettext import gettext as _
18+
1619
class AudioPropertyPage(GObject.GObject, Nemo.PropertyPageProvider, Nemo.NameAndDescProvider):
1720

1821
def get_property_pages(self, files):

nemo-compare/src/nemo-compare.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
from gi.repository import GLib
2626
signal.signal(signal.SIGINT, signal.SIG_DFL)
2727

28+
# Import the gettext function and alias it as _
29+
from gettext import gettext as _
30+
2831
import gi
2932
gi.require_version('Nemo', '3.0')
3033
from gi.repository import Nemo, GObject, Gio

nemo-emblems/nemo-extension/nemo-emblems.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
from gi.repository import Nemo
1010

11+
# Import the gettext function and alias it as _
12+
from gettext import gettext as _
13+
1114
# i18n
1215
APP = 'nemo-extensions'
1316
LOCALE_DIR = "/usr/share/locale"

nemo-media-columns/nemo-media-columns.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
# for reading pdf
4141
from PyPDF2 import PdfFileReader
4242

43+
# Import the gettext function and alias it as _
44+
from gettext import gettext as _
45+
4346
import signal
4447
signal.signal(signal.SIGINT, signal.SIG_DFL)
4548

nemo-pastebin/src/nemo-pastebin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
gi.require_version('Nemo', '3.0')
3838
from gi.repository import Nemo
3939

40+
# Import the gettext function and alias it as _
41+
from gettext import gettext as _
42+
4043
try:
4144
gi.require_version('Notify', '0.7')
4245
from gi.repository import Notify

nemo-terminal/src/nemo_terminal.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
import codecs
4848

4949
import gettext
50+
51+
# Import the gettext function and alias it as _
52+
from gettext import gettext as _
53+
5054
gettext.bindtextdomain("nemo-extensions")
5155
gettext.textdomain("nemo-extensions")
5256
_ = gettext.gettext

0 commit comments

Comments
 (0)