[PATCH] Stop defining _, N_, and P_ all over the place.

Samantha N. Bueno sbueno+anaconda at redhat.com
Thu May 2 02:54:19 UTC 2013


Nice--ACK.

On Wed, May 01, 2013 at 11:52:52AM -0400, Chris Lumens wrote:
> ---
>  pyanaconda/__init__.py                        |  4 +---
>  pyanaconda/bootloader.py                      |  5 +----
>  pyanaconda/constants.py                       |  5 ++---
>  pyanaconda/constants_text.py                  |  3 +--
>  pyanaconda/errors.py                          |  4 +---
>  pyanaconda/exception.py                       |  5 +----
>  pyanaconda/i18n.py                            | 28 +++++++++++++++++++++++++++
>  pyanaconda/image.py                           |  4 +---
>  pyanaconda/install.py                         |  4 +---
>  pyanaconda/installclass.py                    |  4 +---
>  pyanaconda/installclasses/fedora.py           |  3 +--
>  pyanaconda/installinterfacebase.py            |  4 +---
>  pyanaconda/iutil.py                           |  4 +---
>  pyanaconda/kickstart.py                       |  4 +---
>  pyanaconda/network.py                         |  4 +---
>  pyanaconda/packaging/livepayload.py           |  4 +---
>  pyanaconda/packaging/yumpayload.py            |  4 +---
>  pyanaconda/product.py                         |  3 +--
>  pyanaconda/rescue.py                          |  4 +---
>  pyanaconda/text.py                            |  5 +----
>  pyanaconda/ui/gui/__init__.py                 |  4 +---
>  pyanaconda/ui/gui/categories/__init__.py      |  3 +--
>  pyanaconda/ui/gui/categories/customization.py |  3 +--
>  pyanaconda/ui/gui/categories/localization.py  |  3 +--
>  pyanaconda/ui/gui/categories/software.py      |  3 +--
>  pyanaconda/ui/gui/categories/storage.py       |  3 +--
>  pyanaconda/ui/gui/categories/user_settings.py |  3 +--
>  pyanaconda/ui/gui/hubs/__init__.py            |  4 +---
>  pyanaconda/ui/gui/hubs/progress.py            |  4 +---
>  pyanaconda/ui/gui/spokes/advstorage/fcoe.py   |  4 +---
>  pyanaconda/ui/gui/spokes/advstorage/iscsi.py  |  4 +---
>  pyanaconda/ui/gui/spokes/custom.py            |  6 +-----
>  pyanaconda/ui/gui/spokes/datetime_spoke.py    |  5 +----
>  pyanaconda/ui/gui/spokes/filter.py            |  6 +-----
>  pyanaconda/ui/gui/spokes/keyboard.py          |  5 +----
>  pyanaconda/ui/gui/spokes/langsupport.py       |  5 +----
>  pyanaconda/ui/gui/spokes/lib/accordion.py     |  4 +---
>  pyanaconda/ui/gui/spokes/lib/cart.py          |  6 +-----
>  pyanaconda/ui/gui/spokes/lib/detailederror.py |  4 +---
>  pyanaconda/ui/gui/spokes/lib/passphrase.py    |  5 +----
>  pyanaconda/ui/gui/spokes/lib/refresh.py       |  4 +---
>  pyanaconda/ui/gui/spokes/lib/resize.py        |  7 +------
>  pyanaconda/ui/gui/spokes/lib/summary.py       |  4 +---
>  pyanaconda/ui/gui/spokes/network.py           |  6 +-----
>  pyanaconda/ui/gui/spokes/password.py          |  6 +-----
>  pyanaconda/ui/gui/spokes/software.py          |  5 +----
>  pyanaconda/ui/gui/spokes/storage.py           |  6 +-----
>  pyanaconda/ui/gui/spokes/user.py              |  5 +----
>  pyanaconda/ui/gui/spokes/welcome.py           |  5 +----
>  pyanaconda/ui/lib/space.py                    |  5 +----
>  pyanaconda/ui/tui/__init__.py                 |  4 +---
>  pyanaconda/ui/tui/hubs/__init__.py            |  3 +--
>  pyanaconda/ui/tui/hubs/progress.py            |  4 +---
>  pyanaconda/ui/tui/hubs/summary.py             |  4 +---
>  pyanaconda/ui/tui/simpleline/base.py          |  5 +----
>  pyanaconda/ui/tui/spokes/__init__.py          |  4 +---
>  pyanaconda/ui/tui/spokes/askvnc.py            |  5 +----
>  pyanaconda/ui/tui/spokes/password.py          |  5 +----
>  pyanaconda/ui/tui/spokes/storage.py           |  6 +-----
>  pyanaconda/ui/tui/spokes/time.py              |  4 +---
>  pyanaconda/ui/tui/spokes/user.py              |  4 +---
>  pyanaconda/ui/tui/tuiobject.py                |  3 +--
>  pyanaconda/users.py                           |  4 +---
>  pyanaconda/vnc.py                             |  5 +----
>  64 files changed, 92 insertions(+), 210 deletions(-)
>  create mode 100644 pyanaconda/i18n.py
> 
> diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
> index 7804d16..7f3a952 100644
> --- a/pyanaconda/__init__.py
> +++ b/pyanaconda/__init__.py
> @@ -36,14 +36,12 @@ from tempfile import mkstemp
>  from pyanaconda.bootloader import get_bootloader
>  from pyanaconda import constants
>  from pyanaconda import addons
> +from pyanaconda.i18n import _
>  
>  import logging
>  log = logging.getLogger("anaconda")
>  stdoutLog = logging.getLogger("anaconda.stdout")
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  class Anaconda(object):
>      def __init__(self):
>          import desktop
> diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
> index 81bd441..3e4442a 100644
> --- a/pyanaconda/bootloader.py
> +++ b/pyanaconda/bootloader.py
> @@ -38,10 +38,7 @@ from blivet.fcoe import fcoe
>  import pyanaconda.network
>  from pyanaconda.nm import nm_device_hwaddress
>  from blivet import platform
> -
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> +from pyanaconda.i18n import _, N_
>  
>  import logging
>  log = logging.getLogger("anaconda")
> diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
> index 7adb9b6..edc5e7d 100644
> --- a/pyanaconda/constants.py
> +++ b/pyanaconda/constants.py
> @@ -19,10 +19,9 @@
>  # Author(s): Erik Troan <ewt at redhat.com>
>  #
>  
> +from pyanaconda.i18n import _, N_
> +
>  import re
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
>  
>  SELINUX_DEFAULT = 1
>  
> diff --git a/pyanaconda/constants_text.py b/pyanaconda/constants_text.py
> index b93829e..b4b4861 100644
> --- a/pyanaconda/constants_text.py
> +++ b/pyanaconda/constants_text.py
> @@ -18,8 +18,7 @@
>  #
>  
>  from pyanaconda.constants import *
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> +from pyanaconda.i18n import _, N_
>  
>  class Translator:
>      """A simple class to facilitate on-the-fly translation for newt buttons"""
> diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py
> index b08f24a..4b80980 100644
> --- a/pyanaconda/errors.py
> +++ b/pyanaconda/errors.py
> @@ -18,9 +18,7 @@
>  #
>  # Author(s): Chris Lumens <clumens at redhat.com>
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
> +from pyanaconda.i18n import _
>  from pyanaconda.ui.tui import TextUserInterface
>  
>  __all__ = ["ERROR_RAISE", "ERROR_CONTINUE", "ERROR_RETRY",
> diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
> index b89a034..4d62388 100644
> --- a/pyanaconda/exception.py
> +++ b/pyanaconda/exception.py
> @@ -36,6 +36,7 @@ import blivet.errors
>  from pyanaconda.ui.communication import hubQ
>  from pyanaconda.constants import ROOT_PATH, THREAD_EXCEPTION_HANDLING_TEST
>  from pyanaconda.threads import threadMgr
> +from pyanaconda.i18n import _
>  
>  # pylint: disable-msg=E0611
>  from gi.repository import GLib
> @@ -43,10 +44,6 @@ from gi.repository import GLib
>  import logging
>  log = logging.getLogger("anaconda")
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
> -
>  class AnacondaExceptionHandler(ExceptionHandler):
>  
>      def __init__(self, confObj, intfClass, exnClass, tty_num):
> diff --git a/pyanaconda/i18n.py b/pyanaconda/i18n.py
> new file mode 100644
> index 0000000..96cfef6
> --- /dev/null
> +++ b/pyanaconda/i18n.py
> @@ -0,0 +1,28 @@
> +# Translation functions we use all over the place
> +#
> +# Copyright (C) 2013  Red Hat, Inc.
> +#
> +# This copyrighted material is made available to anyone wishing to use,
> +# modify, copy, or redistribute it subject to the terms and conditions of
> +# the GNU General Public License v.2, or (at your option) any later version.
> +# This program is distributed in the hope that it will be useful, but WITHOUT
> +# ANY WARRANTY expressed or implied, including the implied warranties of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
> +# Public License for more details.  You should have received a copy of the
> +# GNU General Public License along with this program; if not, write to the
> +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> +# 02110-1301, USA.  Any Red Hat trademarks that are incorporated in the
> +# source code or documentation are not subject to the GNU General Public
> +# License and may only be used or replicated with the express permission of
> +# Red Hat, Inc.
> +#
> +# Red Hat Author(s): Chris Lumens <clumens at redhat.com>
> +#
> +
> +__all__ = ["_", "N_", "P_"]
> +
> +import gettext
> +
> +_ = lambda x: gettext.ldgettext("anaconda", x)
> +N_ = lambda x: x
> +P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
> diff --git a/pyanaconda/image.py b/pyanaconda/image.py
> index c77587b..d415196 100644
> --- a/pyanaconda/image.py
> +++ b/pyanaconda/image.py
> @@ -21,14 +21,12 @@ import isys
>  import os, os.path, stat, sys
>  from constants import *
>  
> +from pyanaconda.i18n import _
>  from errors import *
>  
>  import blivet.util
>  import blivet.arch
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  import logging
>  log = logging.getLogger("anaconda")
>  
> diff --git a/pyanaconda/install.py b/pyanaconda/install.py
> index 0041778..79b7b6b 100644
> --- a/pyanaconda/install.py
> +++ b/pyanaconda/install.py
> @@ -27,9 +27,7 @@ from pyanaconda.progress import progress_report, progressQ
>  from pyanaconda.users import createLuserConf, getPassAlgo, Users
>  from pyanaconda import flags
>  from pyanaconda import timezone
> -
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> +from pyanaconda.i18n import _
>  
>  def _writeKS(ksdata):
>      import os
> diff --git a/pyanaconda/installclass.py b/pyanaconda/installclass.py
> index 758fe8f..6d0b1e8 100644
> --- a/pyanaconda/installclass.py
> +++ b/pyanaconda/installclass.py
> @@ -28,15 +28,13 @@ import string
>  import imputil
>  import types
>  
> +from pyanaconda.i18n import _
>  from constants import *
>  from product import *
>  from blivet.partspec import *
>  from blivet.devicelibs import swap
>  from blivet.platform import platform
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  import logging
>  log = logging.getLogger("anaconda")
>  
> diff --git a/pyanaconda/installclasses/fedora.py b/pyanaconda/installclasses/fedora.py
> index 89306d1..6f95f85 100644
> --- a/pyanaconda/installclasses/fedora.py
> +++ b/pyanaconda/installclasses/fedora.py
> @@ -22,10 +22,9 @@ from pyanaconda.constants import *
>  from pyanaconda.product import *
>  from pyanaconda import network
>  from pyanaconda import nm
> +from pyanaconda.i18n import _
>  
>  import os, types
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
>  
>  class InstallClass(BaseInstallClass):
>      # name has underscore used for mnemonics, strip if you dont need it
> diff --git a/pyanaconda/installinterfacebase.py b/pyanaconda/installinterfacebase.py
> index 580c189..8e89ecf 100644
> --- a/pyanaconda/installinterfacebase.py
> +++ b/pyanaconda/installinterfacebase.py
> @@ -18,11 +18,9 @@
>  #
>  # Author(s): Hans de Goede <hdegoede at redhat.com>
>  
> -import gettext
>  import sys
>  
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
> +from pyanaconda.i18n import _
>  
>  import logging
>  log = logging.getLogger("anaconda")
> diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
> index 56dceb4..7020da5 100644
> --- a/pyanaconda/iutil.py
> +++ b/pyanaconda/iutil.py
> @@ -32,11 +32,9 @@ from threading import Thread
>  from Queue import Queue, Empty
>  
>  from flags import flags
> +from pyanaconda.i18n import _
>  from constants import *
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  import logging
>  log = logging.getLogger("anaconda")
>  program_log = logging.getLogger("program")
> diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> index fd71f70..3ed6621 100644
> --- a/pyanaconda/kickstart.py
> +++ b/pyanaconda/kickstart.py
> @@ -54,6 +54,7 @@ from pyanaconda import nm
>  from pyanaconda.simpleconfig import SimpleConfigFile
>  from pyanaconda.users import getPassAlgo
>  from pyanaconda.desktop import Desktop
> +from pyanaconda.i18n import _
>  from .ui.common import collect
>  from .addons import AddonSection, AddonData, AddonRegistry, collect_addon_paths
>  
> @@ -65,9 +66,6 @@ from pykickstart.parser import Script as KSScript
>  from pykickstart.sections import *
>  from pykickstart.version import returnClassForVersion
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  import logging
>  log = logging.getLogger("anaconda")
>  stderrLog = logging.getLogger("anaconda.stderr")
> diff --git a/pyanaconda/network.py b/pyanaconda/network.py
> index 42a9294..090141c 100644
> --- a/pyanaconda/network.py
> +++ b/pyanaconda/network.py
> @@ -41,9 +41,7 @@ import blivet.arch
>  
>  from pyanaconda import nm
>  from pyanaconda.constants import NETWORK_CONNECTION_TIMEOUT
> -
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> +from pyanaconda.i18n import _
>  
>  import logging
>  log = logging.getLogger("anaconda")
> diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py
> index 1fdfff2..e27ef7d 100644
> --- a/pyanaconda/packaging/livepayload.py
> +++ b/pyanaconda/packaging/livepayload.py
> @@ -49,9 +49,7 @@ from pyanaconda.progress import progressQ
>  from blivet.size import Size
>  import blivet.util
>  from pyanaconda.threads import threadMgr, AnacondaThread
> -
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> +from pyanaconda.i18n import _
>  
>  class LiveImagePayload(ImagePayload):
>      """ A LivePayload copies the source image onto the target system. """
> diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
> index 9fd313f..c0c1455 100644
> --- a/pyanaconda/packaging/yumpayload.py
> +++ b/pyanaconda/packaging/yumpayload.py
> @@ -71,6 +71,7 @@ from pyanaconda.flags import flags
>  
>  from pyanaconda import iutil
>  from pyanaconda.iutil import ProxyString, ProxyStringError
> +from pyanaconda.i18n import _
>  from pyanaconda.nm import nm_is_connected
>  from blivet.size import Size
>  import blivet.util
> @@ -80,9 +81,6 @@ from pyanaconda.image import opticalInstallMedia
>  from pyanaconda.image import mountImage
>  from pyanaconda.image import findFirstIsoImage
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  from pyanaconda.errors import *
>  from pyanaconda.packaging import NoSuchGroup, NoSuchPackage
>  from pyanaconda.progress import progressQ
> diff --git a/pyanaconda/product.py b/pyanaconda/product.py
> index 0edab7d..1bf1c43 100644
> --- a/pyanaconda/product.py
> +++ b/pyanaconda/product.py
> @@ -20,8 +20,7 @@
>  import ConfigParser
>  import os
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> +from pyanaconda.i18n import _
>  
>  # First, load in the defaults.  In order of precedence:  contents of
>  # .buildstamp, environment, stupid last ditch hardcoded defaults.
> diff --git a/pyanaconda/rescue.py b/pyanaconda/rescue.py
> index b611e7f..788eb25 100644
> --- a/pyanaconda/rescue.py
> +++ b/pyanaconda/rescue.py
> @@ -39,9 +39,7 @@ import network
>  import subprocess
>  from pykickstart.constants import *
>  import meh.ui.text
> -
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> +from pyanaconda.i18n import _
>  
>  import logging
>  log = logging.getLogger("anaconda")
> diff --git a/pyanaconda/text.py b/pyanaconda/text.py
> index fc92625..28fbc3b 100644
> --- a/pyanaconda/text.py
> +++ b/pyanaconda/text.py
> @@ -23,10 +23,7 @@ from snack import *
>  import string
>  from constants_text import *
>  from constants import *
> -
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
> +from pyanaconda.i18n import _
>  
>  class WaitWindow:
>      def pop(self):
> diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
> index ad85fa3..b0e04ef 100644
> --- a/pyanaconda/ui/gui/__init__.py
> +++ b/pyanaconda/ui/gui/__init__.py
> @@ -24,6 +24,7 @@ import meh.ui.gui
>  # pylint: disable-msg=E0611
>  from gi.repository import Gdk, Gtk, AnacondaWidgets
>  
> +from pyanaconda.i18n import _
>  from pyanaconda.product import distributionText, isFinal
>  
>  from pyanaconda.ui import UserInterface, common
> @@ -31,9 +32,6 @@ from pyanaconda.ui.gui.utils import enlightbox, gtk_action_wait
>  from pyanaconda.product import isFinal, productName, productVersion
>  import os.path
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  import logging
>  log = logging.getLogger("anaconda")
>  
> diff --git a/pyanaconda/ui/gui/categories/__init__.py b/pyanaconda/ui/gui/categories/__init__.py
> index 7a75e5c..b5e5b4c 100644
> --- a/pyanaconda/ui/gui/categories/__init__.py
> +++ b/pyanaconda/ui/gui/categories/__init__.py
> @@ -19,9 +19,8 @@
>  # Red Hat Author(s): Chris Lumens <clumens at redhat.com>
>  #
>  
> -N_ = lambda x: x
> -
>  import os.path
> +from pyanaconda.i18n import N_
>  from pyanaconda.ui.common import collect
>  
>  __all__ = ["SpokeCategory", "collect_categories"]
> diff --git a/pyanaconda/ui/gui/categories/customization.py b/pyanaconda/ui/gui/categories/customization.py
> index 68b422c..ebd1b51 100644
> --- a/pyanaconda/ui/gui/categories/customization.py
> +++ b/pyanaconda/ui/gui/categories/customization.py
> @@ -20,8 +20,7 @@
>  #                    Martin Sivak <msivak at redhat.com>
>  #
>  
> -N_ = lambda x: x
> -
> +from pyanaconda.i18n import N_
>  from pyanaconda.ui.gui.categories import SpokeCategory
>  from pyanaconda.ui.gui.hubs.progress import ProgressHub
>  
> diff --git a/pyanaconda/ui/gui/categories/localization.py b/pyanaconda/ui/gui/categories/localization.py
> index 577efdc..2e2f5a4 100644
> --- a/pyanaconda/ui/gui/categories/localization.py
> +++ b/pyanaconda/ui/gui/categories/localization.py
> @@ -19,8 +19,7 @@
>  # Red Hat Author(s): Chris Lumens <clumens at redhat.com>
>  #
>  
> -N_ = lambda x: x
> -
> +from pyanaconda.i18n import N_
>  from pyanaconda.ui.gui.categories import SpokeCategory
>  from pyanaconda.ui.gui.hubs.summary import SummaryHub
>  
> diff --git a/pyanaconda/ui/gui/categories/software.py b/pyanaconda/ui/gui/categories/software.py
> index 0b84499..09f2fd7 100644
> --- a/pyanaconda/ui/gui/categories/software.py
> +++ b/pyanaconda/ui/gui/categories/software.py
> @@ -19,8 +19,7 @@
>  # Red Hat Author(s): Chris Lumens <clumens at redhat.com>
>  #
>  
> -N_ = lambda x: x
> -
> +from pyanaconda.i18n import N_
>  from pyanaconda.ui.gui.categories import SpokeCategory
>  from pyanaconda.ui.gui.hubs.summary import SummaryHub
>  
> diff --git a/pyanaconda/ui/gui/categories/storage.py b/pyanaconda/ui/gui/categories/storage.py
> index e24515f..696d7e2 100644
> --- a/pyanaconda/ui/gui/categories/storage.py
> +++ b/pyanaconda/ui/gui/categories/storage.py
> @@ -20,8 +20,7 @@
>  #                    David Lehman <dlehman at redhat.com>
>  #
>  
> -N_ = lambda x: x
> -
> +from pyanaconda.i18n import N_
>  from pyanaconda.ui.gui.categories import SpokeCategory
>  from pyanaconda.ui.gui.hubs.summary import SummaryHub
>  
> diff --git a/pyanaconda/ui/gui/categories/user_settings.py b/pyanaconda/ui/gui/categories/user_settings.py
> index b9838b8..6a64401 100644
> --- a/pyanaconda/ui/gui/categories/user_settings.py
> +++ b/pyanaconda/ui/gui/categories/user_settings.py
> @@ -20,8 +20,7 @@
>  #                    Martin Sivak <msivak at redhat.com>
>  #
>  
> -N_ = lambda x: x
> -
> +from pyanaconda.i18n import N_
>  from pyanaconda.ui.gui.categories import SpokeCategory
>  from pyanaconda.ui.gui.hubs.progress import ProgressHub
>  
> diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
> index 53143d4..dbd95f8 100644
> --- a/pyanaconda/ui/gui/hubs/__init__.py
> +++ b/pyanaconda/ui/gui/hubs/__init__.py
> @@ -19,15 +19,13 @@
>  # Red Hat Author(s): Chris Lumens <clumens at redhat.com>
>  #
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  import os
>  
>  # pylint: disable-msg=E0611
>  from gi.repository import GLib
>  
>  from pyanaconda.flags import flags
> +from pyanaconda.i18n import _
>  from pyanaconda.product import distributionText
>  
>  from pyanaconda.ui import common
> diff --git a/pyanaconda/ui/gui/hubs/progress.py b/pyanaconda/ui/gui/hubs/progress.py
> index e28c6a3..935c10b 100644
> --- a/pyanaconda/ui/gui/hubs/progress.py
> +++ b/pyanaconda/ui/gui/hubs/progress.py
> @@ -21,15 +21,13 @@
>  
>  from __future__ import division
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  from gi.repository import GLib, Gtk
>  
>  import itertools
>  import os
>  import sys
>  
> +from pyanaconda.i18n import _
>  from pyanaconda.localization import expand_langs
>  from pyanaconda.product import productName
>  from pyanaconda.flags import flags
> diff --git a/pyanaconda/ui/gui/spokes/advstorage/fcoe.py b/pyanaconda/ui/gui/spokes/advstorage/fcoe.py
> index 8dfdf5d..bbc9cea 100644
> --- a/pyanaconda/ui/gui/spokes/advstorage/fcoe.py
> +++ b/pyanaconda/ui/gui/spokes/advstorage/fcoe.py
> @@ -27,9 +27,7 @@ from pyanaconda.threads import threadMgr, AnacondaThread
>  from pyanaconda.ui.gui import GUIObject
>  from pyanaconda.ui.gui.utils import gtk_action_wait
>  from pyanaconda import nm
> -
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> +from pyanaconda.i18n import _
>  
>  __all__ = ["FCoEDialog"]
>  
> diff --git a/pyanaconda/ui/gui/spokes/advstorage/iscsi.py b/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
> index 542d7a4..89ce317 100644
> --- a/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
> +++ b/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
> @@ -28,9 +28,7 @@ from pyanaconda import constants
>  from pyanaconda.threads import threadMgr, AnacondaThread
>  from pyanaconda.ui.gui import GUIObject
>  from pyanaconda import nm
> -
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> +from pyanaconda.i18n import _
>  
>  __all__ = ["ISCSIDialog"]
>  
> diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
> index 7c4590f..423f1a4 100644
> --- a/pyanaconda/ui/gui/spokes/custom.py
> +++ b/pyanaconda/ui/gui/spokes/custom.py
> @@ -27,16 +27,12 @@
>  # - Tabbing behavior in the accordion is weird.
>  # - Implement striping and mirroring for LVM.
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
> -
>  from contextlib import contextmanager
>  import re
>  
>  from pykickstart.constants import *
>  
> +from pyanaconda.i18n import _, N_, P_
>  from pyanaconda.product import productName, productVersion
>  from pyanaconda.threads import AnacondaThread, threadMgr
>  from pyanaconda.constants import THREAD_EXECUTE_STORAGE, THREAD_STORAGE, THREAD_CUSTOM_STORAGE_INIT
> diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
> index b760346..e21ca32 100644
> --- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
> +++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
> @@ -19,10 +19,6 @@
>  # Red Hat Author(s): Vratislav Podzimek <vpodzime at redhat.com>
>  #
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -
>  import logging
>  log = logging.getLogger("anaconda")
>  
> @@ -36,6 +32,7 @@ from pyanaconda.ui.gui.spokes import NormalSpoke
>  from pyanaconda.ui.gui.categories.localization import LocalizationCategory
>  from pyanaconda.ui.gui.utils import enlightbox, gtk_action_nowait, gtk_action_wait, gtk_call_once
>  
> +from pyanaconda.i18n import _, N_
>  from pyanaconda import timezone
>  from pyanaconda.timezone import NTP_SERVICE
>  from pyanaconda import iutil
> diff --git a/pyanaconda/ui/gui/spokes/filter.py b/pyanaconda/ui/gui/spokes/filter.py
> index c6840e6..808e67f 100644
> --- a/pyanaconda/ui/gui/spokes/filter.py
> +++ b/pyanaconda/ui/gui/spokes/filter.py
> @@ -19,11 +19,6 @@
>  # Red Hat Author(s): Chris Lumens <clumens at redhat.com>
>  #
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
> -
>  from collections import namedtuple
>  import itertools
>  
> @@ -32,6 +27,7 @@ from blivet.devices import DASDDevice, FcoeDiskDevice, iScsiDiskDevice, Multipat
>  from blivet.fcoe import has_fcoe
>  
>  from pyanaconda.flags import flags
> +from pyanaconda.i18n import _, N_, P_
>  
>  from pyanaconda.ui.lib.disks import getDisks, isLocalDisk, size_str
>  from pyanaconda.ui.gui.utils import enlightbox
> diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py
> index c2a9de5..b280635 100644
> --- a/pyanaconda/ui/gui/spokes/keyboard.py
> +++ b/pyanaconda/ui/gui/spokes/keyboard.py
> @@ -20,10 +20,6 @@
>  #                    Vratislav Podzimek <vpodzime at redhat.com>
>  #
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -
>  # pylint: disable-msg=E0611
>  from gi.repository import GLib, Gkbd, Gtk, Gdk
>  
> @@ -33,6 +29,7 @@ from pyanaconda.ui.gui.categories.localization import LocalizationCategory
>  from pyanaconda.ui.gui.utils import enlightbox, gtk_call_once
>  from pyanaconda import keyboard
>  from pyanaconda import flags
> +from pyanaconda.i18n import _, N_
>  
>  __all__ = ["KeyboardSpoke"]
>  
> diff --git a/pyanaconda/ui/gui/spokes/langsupport.py b/pyanaconda/ui/gui/spokes/langsupport.py
> index e45c153..8e90cb7 100644
> --- a/pyanaconda/ui/gui/spokes/langsupport.py
> +++ b/pyanaconda/ui/gui/spokes/langsupport.py
> @@ -19,12 +19,9 @@
>  # Red Hat Author(s): Radek Vykydal <rvykydal at redhat.com>
>  #
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -
>  from gi.repository import Gtk, Pango
>  from pyanaconda.flags import flags
> +from pyanaconda.i18n import _, N_
>  from pyanaconda.ui.gui.spokes import NormalSpoke
>  from pyanaconda.ui.gui.categories.localization import LocalizationCategory
>  from pyanaconda.localization import Language, LOCALE_PREFERENCES, expand_langs
> diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py b/pyanaconda/ui/gui/spokes/lib/accordion.py
> index bf6debb..f6f26b3 100644
> --- a/pyanaconda/ui/gui/spokes/lib/accordion.py
> +++ b/pyanaconda/ui/gui/spokes/lib/accordion.py
> @@ -20,11 +20,9 @@
>  # Red Hat Author(s): Chris Lumens <clumens at redhat.com>
>  #
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  from blivet.size import Size
>  
> +from pyanaconda.i18n import _
>  from pyanaconda.product import productName, productVersion
>  
>  from gi.repository.AnacondaWidgets import MountpointSelector
> diff --git a/pyanaconda/ui/gui/spokes/lib/cart.py b/pyanaconda/ui/gui/spokes/lib/cart.py
> index 7b47539..80f308a 100644
> --- a/pyanaconda/ui/gui/spokes/lib/cart.py
> +++ b/pyanaconda/ui/gui/spokes/lib/cart.py
> @@ -22,15 +22,11 @@
>  
>  from gi.repository import Gtk
>  
> +from pyanaconda.i18n import _, P_
>  from pyanaconda.ui.lib.disks import size_str
>  from pyanaconda.ui.gui import GUIObject
>  from blivet.size import Size
>  
> -import gettext
> -
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
> -
>  __all__ = ["SelectedDisksDialog"]
>  
>  IS_BOOT_COL = 0
> diff --git a/pyanaconda/ui/gui/spokes/lib/detailederror.py b/pyanaconda/ui/gui/spokes/lib/detailederror.py
> index 20feb88..b68a4e2 100644
> --- a/pyanaconda/ui/gui/spokes/lib/detailederror.py
> +++ b/pyanaconda/ui/gui/spokes/lib/detailederror.py
> @@ -21,11 +21,9 @@
>  
>  from gi.repository import Gtk
>  
> +from pyanaconda.i18n import _
>  from pyanaconda.ui.gui import GUIObject
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  __all__ = ["DetailedErrorDialog"]
>  
>  class DetailedErrorDialog(GUIObject):
> diff --git a/pyanaconda/ui/gui/spokes/lib/passphrase.py b/pyanaconda/ui/gui/spokes/lib/passphrase.py
> index 3ae8616..c917888 100644
> --- a/pyanaconda/ui/gui/spokes/lib/passphrase.py
> +++ b/pyanaconda/ui/gui/spokes/lib/passphrase.py
> @@ -28,10 +28,7 @@ import pwquality
>  from pyanaconda.ui.gui import GUIObject
>  
>  from pyanaconda import keyboard
> -
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
> +from pyanaconda.i18n import _, N_, P_
>  
>  __all__ = ["PassphraseDialog"]
>  
> diff --git a/pyanaconda/ui/gui/spokes/lib/refresh.py b/pyanaconda/ui/gui/spokes/lib/refresh.py
> index 702ca6c..445575d 100644
> --- a/pyanaconda/ui/gui/spokes/lib/refresh.py
> +++ b/pyanaconda/ui/gui/spokes/lib/refresh.py
> @@ -25,12 +25,10 @@ from gi.repository import GLib, Gtk
>  from pyanaconda.threads import threadMgr, AnacondaThread
>  from pyanaconda.ui.gui import GUIObject
>  from pyanaconda import constants
> +from pyanaconda.i18n import _
>  
>  from blivet import storageInitialize
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  __all__ = ["RefreshDialog"]
>  
>  class RefreshDialog(GUIObject):
> diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py b/pyanaconda/ui/gui/spokes/lib/resize.py
> index 7f4a402..109ec65 100644
> --- a/pyanaconda/ui/gui/spokes/lib/resize.py
> +++ b/pyanaconda/ui/gui/spokes/lib/resize.py
> @@ -23,16 +23,11 @@ from __future__ import division
>  
>  from gi.repository import Gtk
>  
> +from pyanaconda.i18n import _, N_, P_
>  from pyanaconda.ui.lib.disks import size_str
>  from pyanaconda.ui.gui import GUIObject
>  from blivet.size import Size
>  
> -import gettext
> -
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
> -
>  __all__ = ["ResizeDialog"]
>  
>  DEVICE_ID_COL = 0
> diff --git a/pyanaconda/ui/gui/spokes/lib/summary.py b/pyanaconda/ui/gui/spokes/lib/summary.py
> index a4a0899..3982e3f 100644
> --- a/pyanaconda/ui/gui/spokes/lib/summary.py
> +++ b/pyanaconda/ui/gui/spokes/lib/summary.py
> @@ -21,13 +21,11 @@
>  
>  from gi.repository import Gtk
>  
> +from pyanaconda.i18n import _
>  from pyanaconda.ui.gui import GUIObject
>  
>  from blivet.deviceaction import ACTION_TYPE_DESTROY, ACTION_TYPE_RESIZE, ACTION_OBJECT_FORMAT
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  __all__ = ["ActionSummaryDialog"]
>  
>  class ActionSummaryDialog(GUIObject):
> diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
> index d717d08..597419e 100644
> --- a/pyanaconda/ui/gui/spokes/network.py
> +++ b/pyanaconda/ui/gui/spokes/network.py
> @@ -34,6 +34,7 @@
>  from gi.repository import Gtk, AnacondaWidgets
>  
>  from pyanaconda.flags import flags
> +from pyanaconda.i18n import _, N_, P_
>  from pyanaconda import constants
>  from pyanaconda.ui.communication import hubQ
>  from pyanaconda.ui.gui import GUIObject
> @@ -58,11 +59,6 @@ import ctypes
>  ctypes.cdll.LoadLibrary("libnm-util.so.2")
>  nm_utils = ctypes.CDLL("libnm-util.so.2")
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
> -
>  import logging
>  log = logging.getLogger("anaconda")
>  
> diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py
> index e6bb5a3..3151ee2 100644
> --- a/pyanaconda/ui/gui/spokes/password.py
> +++ b/pyanaconda/ui/gui/spokes/password.py
> @@ -19,15 +19,11 @@
>  # Red Hat Author(s): Jesse Keating <jkeating at redhat.com>
>  #
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -
>  from gi.repository import Gtk
>  
> +from pyanaconda.i18n import _, N_
>  from pyanaconda.users import cryptPassword, validatePassword
>  from pwquality import PWQError
> -import string
>  
>  from pyanaconda.ui.gui.spokes import NormalSpoke
>  from pyanaconda.ui.gui.categories.user_settings import UserSettingsCategory
> diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
> index b409aea..f817d88 100644
> --- a/pyanaconda/ui/gui/spokes/software.py
> +++ b/pyanaconda/ui/gui/spokes/software.py
> @@ -19,14 +19,11 @@
>  # Red Hat Author(s): Chris Lumens <clumens at redhat.com>
>  #
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -
>  # pylint: disable-msg=E0611
>  from gi.repository import Gdk, Gtk
>  
>  from pyanaconda.flags import flags
> +from pyanaconda.i18n import _, N_
>  from pyanaconda.packaging import MetadataError
>  from pyanaconda.threads import threadMgr, AnacondaThread
>  from pyanaconda import constants
> diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
> index 0ac829f..5662849 100644
> --- a/pyanaconda/ui/gui/spokes/storage.py
> +++ b/pyanaconda/ui/gui/spokes/storage.py
> @@ -61,17 +61,13 @@ from blivet.platform import platform
>  from pyanaconda.threads import threadMgr, AnacondaThread
>  from pyanaconda.product import productName
>  from pyanaconda.flags import flags
> +from pyanaconda.i18n import _, N_, P_
>  from pyanaconda import constants
>  
>  from pykickstart.constants import *
>  
> -import gettext
>  import sys
>  
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
> -
>  import logging
>  log = logging.getLogger("anaconda")
>  
> diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
> index 646bbdb..2c9cd1b 100644
> --- a/pyanaconda/ui/gui/spokes/user.py
> +++ b/pyanaconda/ui/gui/spokes/user.py
> @@ -19,12 +19,9 @@
>  # Red Hat Author(s): Martin Sivak <msivak at redhat.com>
>  #
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -
>  from gi.repository import Gtk
>  
> +from pyanaconda.i18n import _, N_
>  from pyanaconda.users import cryptPassword, validatePassword, guess_username
>  from pwquality import PWQError
>  
> diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
> index f9791cb..28e1373 100644
> --- a/pyanaconda/ui/gui/spokes/welcome.py
> +++ b/pyanaconda/ui/gui/spokes/welcome.py
> @@ -22,10 +22,6 @@
>  import sys
>  import re
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> -
>  # pylint: disable-msg=E0611
>  from gi.repository import AnacondaWidgets, Gtk, Pango
>  from pyanaconda.ui.gui.hubs.summary import SummaryHub
> @@ -38,6 +34,7 @@ from pyanaconda import keyboard
>  from pyanaconda import timezone
>  from pyanaconda import flags
>  from pyanaconda import geoloc
> +from pyanaconda.i18n import _, N_
>  
>  import logging
>  log = logging.getLogger("anaconda")
> diff --git a/pyanaconda/ui/lib/space.py b/pyanaconda/ui/lib/space.py
> index 9bf6292..83c6134 100644
> --- a/pyanaconda/ui/lib/space.py
> +++ b/pyanaconda/ui/lib/space.py
> @@ -21,10 +21,7 @@
>  
>  from blivet.size import Size
>  
> -import gettext
> -
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> +from pyanaconda.i18n import _, N_
>  
>  import logging
>  log = logging.getLogger("anaconda")
> diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
> index b3824b0..b1d3b50 100644
> --- a/pyanaconda/ui/tui/__init__.py
> +++ b/pyanaconda/ui/tui/__init__.py
> @@ -20,6 +20,7 @@
>  #
>  
>  from pyanaconda import ui
> +from pyanaconda.i18n import _
>  from pyanaconda.ui import common
>  from pyanaconda.ui.communication import hubQ
>  from pyanaconda.flags import flags
> @@ -34,9 +35,6 @@ import sys
>  import site
>  import meh.ui.text
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  def exception_msg_handler(event, data):
>      """
>      Handler for the HUB_CODE_EXCEPTION message in the hubQ.
> diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py
> index 1cb9cea..14e6957 100644
> --- a/pyanaconda/ui/tui/hubs/__init__.py
> +++ b/pyanaconda/ui/tui/hubs/__init__.py
> @@ -23,8 +23,7 @@ from pyanaconda.ui.tui.tuiobject import TUIObject
>  from pyanaconda.ui.tui.spokes import collect_spokes
>  from pyanaconda.ui import common
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> +from pyanaconda.i18n import _
>  
>  class TUIHub(TUIObject, common.Hub):
>      """Base Hub class implementing the pyanaconda.ui.common.Hub interface.
> diff --git a/pyanaconda/ui/tui/hubs/progress.py b/pyanaconda/ui/tui/hubs/progress.py
> index 2be443b..90d5731 100644
> --- a/pyanaconda/ui/tui/hubs/progress.py
> +++ b/pyanaconda/ui/tui/hubs/progress.py
> @@ -22,10 +22,8 @@
>  import time
>  import sys
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  from pyanaconda.flags import flags
> +from pyanaconda.i18n import _
>  from pyanaconda.constants import THREAD_INSTALL, THREAD_CONFIGURATION
>  from pykickstart.constants import KS_SHUTDOWN, KS_REBOOT
>  
> diff --git a/pyanaconda/ui/tui/hubs/summary.py b/pyanaconda/ui/tui/hubs/summary.py
> index 6f6ad5c..ebbfcfb 100644
> --- a/pyanaconda/ui/tui/hubs/summary.py
> +++ b/pyanaconda/ui/tui/hubs/summary.py
> @@ -22,12 +22,10 @@
>  
>  from pyanaconda.ui.tui.hubs import TUIHub
>  from pyanaconda.flags import flags
> +from pyanaconda.i18n import _
>  import sys
>  import time
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  class SummaryHub(TUIHub):
>      title = _("Installation")
>      categories = ["source", "localization", "destination", "password"]
> diff --git a/pyanaconda/ui/tui/simpleline/base.py b/pyanaconda/ui/tui/simpleline/base.py
> index 1ce2b56..ff4660c 100644
> --- a/pyanaconda/ui/tui/simpleline/base.py
> +++ b/pyanaconda/ui/tui/simpleline/base.py
> @@ -29,10 +29,7 @@ import threading
>  from pyanaconda.threads import threadMgr, AnacondaThread
>  from pyanaconda.ui.communication import hubQ
>  from pyanaconda import constants
> -
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -N_ = lambda x: x
> +from pyanaconda.i18n import _, N_
>  
>  RAW_INPUT_LOCK = threading.Lock()
>  
> diff --git a/pyanaconda/ui/tui/spokes/__init__.py b/pyanaconda/ui/tui/spokes/__init__.py
> index 6b3c868..b770351 100644
> --- a/pyanaconda/ui/tui/spokes/__init__.py
> +++ b/pyanaconda/ui/tui/spokes/__init__.py
> @@ -26,9 +26,7 @@ from pwquality import PWQError
>  import re
>  from collections import namedtuple
>  from pyanaconda.iutil import setdeepattr, getdeepattr
> -
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> +from pyanaconda.i18n import _
>  
>  __all__ = ["TUISpoke", "EditTUISpoke", "EditTUIDialog", "EditTUISpokeEntry", "StandaloneSpoke", "NormalSpoke", "PersonalizationSpoke",
>             "collect_spokes", "collect_categories"]
> diff --git a/pyanaconda/ui/tui/spokes/askvnc.py b/pyanaconda/ui/tui/spokes/askvnc.py
> index fc437f9..9847874 100644
> --- a/pyanaconda/ui/tui/spokes/askvnc.py
> +++ b/pyanaconda/ui/tui/spokes/askvnc.py
> @@ -22,12 +22,9 @@
>  from pyanaconda.ui.tui.spokes import NormalTUISpoke
>  from pyanaconda.ui.tui.simpleline import TextWidget, ColumnWidget
>  from pyanaconda.constants import USEVNC, USETEXT
> +from pyanaconda.i18n import _
>  import getpass
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
> -
>  class AskVNCSpoke(NormalTUISpoke):
>      title = _("VNC")
>      category = "vnc"
> diff --git a/pyanaconda/ui/tui/spokes/password.py b/pyanaconda/ui/tui/spokes/password.py
> index 2bc2b52..f8b9cf4 100644
> --- a/pyanaconda/ui/tui/spokes/password.py
> +++ b/pyanaconda/ui/tui/spokes/password.py
> @@ -24,10 +24,7 @@ from pyanaconda.ui.tui.spokes import EditTUIDialog, EditTUISpokeEntry
>  from pyanaconda.ui.common import FirstbootSpokeMixIn
>  from pyanaconda.ui.tui.simpleline import TextWidget
>  from pyanaconda.users import cryptPassword
> -
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
> +from pyanaconda.i18n import _
>  
>  class PasswordSpoke(FirstbootSpokeMixIn, EditTUIDialog):
>      title = _("Set root password")
> diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py
> index 316a912..3e8d9e7 100644
> --- a/pyanaconda/ui/tui/spokes/storage.py
> +++ b/pyanaconda/ui/tui/spokes/storage.py
> @@ -33,17 +33,13 @@ from pyanaconda.flags import flags
>  from pyanaconda.kickstart import doKickstartStorage
>  from pyanaconda.threads import threadMgr, AnacondaThread
>  from pyanaconda import constants
> +from pyanaconda.i18n import _, P_
>  
>  from pykickstart.constants import *
>  
>  import logging
>  log = logging.getLogger("anaconda")
>  
> -import gettext
> -
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
> -
>  __all__ = ["StorageSpoke", "AutoPartSpoke"]
>  
>  CLEARALL = _("Use All Space")
> diff --git a/pyanaconda/ui/tui/spokes/time.py b/pyanaconda/ui/tui/spokes/time.py
> index 6a30778..7887b96 100644
> --- a/pyanaconda/ui/tui/spokes/time.py
> +++ b/pyanaconda/ui/tui/spokes/time.py
> @@ -23,9 +23,7 @@ from pyanaconda.ui.tui.spokes import NormalTUISpoke
>  from pyanaconda.ui.tui.simpleline import TextWidget, ColumnWidget
>  from pyanaconda.ui.common import FirstbootSpokeMixIn
>  from pyanaconda import timezone
> -
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> +from pyanaconda.i18n import _
>  
>  class TimeZoneSpoke(FirstbootSpokeMixIn, NormalTUISpoke):
>      title = _("Timezone settings")
> diff --git a/pyanaconda/ui/tui/spokes/user.py b/pyanaconda/ui/tui/spokes/user.py
> index 83a1440..a6d36cb 100644
> --- a/pyanaconda/ui/tui/spokes/user.py
> +++ b/pyanaconda/ui/tui/spokes/user.py
> @@ -25,11 +25,9 @@ from pyanaconda.ui.common import FirstbootSpokeMixIn
>  from pyanaconda.ui.tui.simpleline import TextWidget
>  from pyanaconda.ui.tui import YesNoDialog
>  from pyanaconda.users import guess_username
> +from pyanaconda.i18n import _
>  
>  import re
> -import gettext
> -
> -_ = lambda x: gettext.ldgettext("anaconda", x)
>  
>  __all__ = ["UserSpoke"]
>  
> diff --git a/pyanaconda/ui/tui/tuiobject.py b/pyanaconda/ui/tui/tuiobject.py
> index 08b95c0..e2c96f7 100644
> --- a/pyanaconda/ui/tui/tuiobject.py
> +++ b/pyanaconda/ui/tui/tuiobject.py
> @@ -19,10 +19,9 @@
>  # Red Hat Author(s): Martin Sivak <msivak at redhat.com>
>  #
>  
> +from pyanaconda.i18n import _
>  from pyanaconda.ui import common
>  import simpleline as tui
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
>  
>  class ErrorDialog(tui.UIScreen):
>      """Dialog screen for reporting errors to user."""
> diff --git a/pyanaconda/users.py b/pyanaconda/users.py
> index bd50536..212184b 100644
> --- a/pyanaconda/users.py
> +++ b/pyanaconda/users.py
> @@ -30,13 +30,11 @@ import iutil
>  import pwquality
>  from pyanaconda.constants import ROOT_PATH
>  from pyanaconda.iutil import strip_accents
> +from pyanaconda.i18n import _
>  
>  import logging
>  log = logging.getLogger("anaconda")
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -
>  def createLuserConf(instPath, algoname='sha512'):
>      """ Writes a libuser.conf for instPath.
>  
> diff --git a/pyanaconda/vnc.py b/pyanaconda/vnc.py
> index f016299..ef008e5 100644
> --- a/pyanaconda/vnc.py
> +++ b/pyanaconda/vnc.py
> @@ -28,13 +28,10 @@ import socket
>  import subprocess
>  import iutil
>  
> +from pyanaconda.i18n import _, P_
>  from pyanaconda.ui.tui.simpleline import App
>  from pyanaconda.ui.tui.spokes.askvnc import VNCPassSpoke
>  
> -import gettext
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> -P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
> -
>  import logging
>  log = logging.getLogger("anaconda")
>  stdoutLog = logging.getLogger("anaconda.stdout")
> -- 
> 1.8.1.2
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches


More information about the anaconda-patches mailing list