diff options
-rw-r--r-- | sos/__init__.py | 10 | ||||
-rw-r--r-- | sos/policies/__init__.py | 2 | ||||
-rw-r--r-- | sos/utilities.py | 12 |
3 files changed, 11 insertions, 13 deletions
diff --git a/sos/__init__.py b/sos/__init__.py index e367d6a7..67871f13 100644 --- a/sos/__init__.py +++ b/sos/__init__.py @@ -24,6 +24,16 @@ import tempfile from argparse import ArgumentParser from sos.options import SosListOption +import gettext +gettext_dir = "/usr/share/locale" +gettext_app = "sos" +gettext.bindtextdomain(gettext_app, gettext_dir) + +def _default(msg): + return gettext.dgettext(gettext_app, msg) + +_sos = _default + class SoS(): """Main entrypoint for sos from the command line diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py index 207ca793..91e8be0e 100644 --- a/sos/policies/__init__.py +++ b/sos/policies/__init__.py @@ -18,8 +18,8 @@ from sos.utilities import (ImporterHelper, shell_out, sos_get_command_output) from sos.report.plugins import IndependentPlugin, ExperimentalPlugin -from sos.utilities import _sos as _ from sos.options import SoSOptions +from sos import _sos as _ from textwrap import fill from six import print_ from six.moves import input diff --git a/sos/utilities.py b/sos/utilities.py index 5ac90be9..7921dfa7 100644 --- a/sos/utilities.py +++ b/sos/utilities.py @@ -20,7 +20,6 @@ import glob import tempfile import threading import time -import gettext from contextlib import closing from collections import deque @@ -28,17 +27,6 @@ from collections import deque # PYCOMPAT import six -gettext_dir = "/usr/share/locale" -gettext_app = "sos" - -gettext.bindtextdomain(gettext_app, gettext_dir) - - -def _default(msg): - return gettext.dgettext(gettext_app, msg) - - -_sos = _default def tail(filename, number_of_bytes): """Returns the last number_of_bytes of filename""" |