diff --git a/lib/logitech_receiver/i18n.py b/lib/logitech_receiver/i18n.py index 43210364..7b105408 100644 --- a/lib/logitech_receiver/i18n.py +++ b/lib/logitech_receiver/i18n.py @@ -27,8 +27,10 @@ import gettext as _gettext try: unicode _ = lambda x: _gettext.gettext(x).decode('UTF-8') + ngettext = lambda *x: _gettext.ngettext(*x).decode('UTF-8') except: _ = _gettext.gettext + ngettext = _gettext.ngettext # A few common strings, not always accessible as such in the code. diff --git a/lib/logitech_receiver/status.py b/lib/logitech_receiver/status.py index 5dbe3614..ea5ccd54 100644 --- a/lib/logitech_receiver/status.py +++ b/lib/logitech_receiver/status.py @@ -26,8 +26,7 @@ _log = getLogger(__name__) del getLogger -from .i18n import _ -from gettext import ngettext +from .i18n import _, ngettext from .common import NamedInts as _NamedInts, NamedInt as _NamedInt from . import hidpp10 as _hidpp10 from . import hidpp20 as _hidpp20 diff --git a/lib/solaar/i18n.py b/lib/solaar/i18n.py index 7e981cf6..b2094ce8 100644 --- a/lib/solaar/i18n.py +++ b/lib/solaar/i18n.py @@ -60,5 +60,7 @@ _gettext.install(_LOCALE_DOMAIN) try: unicode _ = lambda x: _gettext.gettext(x).decode('UTF-8') + ngettext = lambda *x: _gettext.ngettext(*x).decode('UTF-8') except: _ = _gettext.gettext + ngettext = _gettext.ngettext diff --git a/lib/solaar/ui/window.py b/lib/solaar/ui/window.py index 7e7ff955..446213d2 100644 --- a/lib/solaar/ui/window.py +++ b/lib/solaar/ui/window.py @@ -26,10 +26,8 @@ del getLogger from gi.repository import Gtk, Gdk, GLib from gi.repository.GObject import TYPE_PYOBJECT - from solaar import NAME -from solaar.i18n import _ -from gettext import ngettext +from solaar.i18n import _, ngettext # from solaar import __version__ as VERSION from solaar.ui import ui_async as _ui_async from logitech_receiver import hidpp10 as _hidpp10