Skip to content

Commit 93d56b2

Browse files
committed
nemo-media-columns.py: Fix translations for column names.
1 parent 68ed0a3 commit 93d56b2

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
# mtwebster: convert for use as a nemo extension
2525
import os
2626
import stopit
27-
27+
import locale
28+
import gettext
2829
from urllib import parse
2930
import gi
3031
gi.require_version('GExiv2', '0.10')
@@ -42,9 +43,12 @@
4243
import signal
4344
signal.signal(signal.SIGINT, signal.SIG_DFL)
4445

45-
import gettext
46-
gettext.bindtextdomain("nemo-extensions")
47-
gettext.textdomain("nemo-extensions")
46+
# initialize i18n
47+
APP = 'nemo-extensions'
48+
LOCALE_DIR = "/usr/share/locale"
49+
locale.bindtextdomain(APP, LOCALE_DIR)
50+
gettext.bindtextdomain(APP, LOCALE_DIR)
51+
gettext.textdomain(APP)
4852
_ = gettext.gettext
4953

5054
class FileExtensionInfo():
@@ -88,6 +92,11 @@ def load_settings(self, settings, pspec=None, data=None):
8892
print("nemo-media-columns: using a timeout of %.2f second(s) for file processing" % self.timeout)
8993

9094
def get_columns(self):
95+
locale.bindtextdomain(APP, LOCALE_DIR)
96+
gettext.bindtextdomain(APP, LOCALE_DIR)
97+
gettext.textdomain(APP)
98+
_ = gettext.gettext
99+
91100
return (
92101
Nemo.Column(name="NemoPython::title_column",attribute="title",label=_("Title"),description=""),
93102
Nemo.Column(name="NemoPython::album_column",attribute="album",label=_("Album"),description=""),

0 commit comments

Comments
 (0)