Move to oslo.i18n

This brings in i18n.py from ironic (as a helper) and switches all i18n
references to use that module.

The _i18n module from oslo-incubator is left, as syncing imageutils
brings it in.

Change-Id: I012ceb7031695407febbb3bbd24622773a2d9d0f
This commit is contained in:
Jim Rollenhagen 2015-09-30 08:19:43 -07:00
parent 86e25fc1b2
commit cf73a8fb7f
7 changed files with 41 additions and 9 deletions

View File

31
ironic_lib/common/i18n.py Normal file
View File

@ -0,0 +1,31 @@
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import oslo_i18n as i18n
_translators = i18n.TranslatorFactory(domain='ironic-lib')
# The primary translation function using the well-known name "_"
_ = _translators.primary
# Translators for log levels.
#
# The abbreviated names are meant to reflect the usual use of a short
# name like '_'. The "L" is for "log" and the other letter comes from
# the level.
_LI = _translators.log_info
_LW = _translators.log_warning
_LE = _translators.log_error
_LC = _translators.log_critical

View File

@ -20,9 +20,9 @@ from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from oslo_service import loopingcall from oslo_service import loopingcall
from ironic_lib.common.i18n import _
from ironic_lib.common.i18n import _LW
from ironic_lib import exception from ironic_lib import exception
from ironic_lib.openstack.common._i18n import _
from ironic_lib.openstack.common._i18n import _LW
from ironic_lib import utils from ironic_lib import utils

View File

@ -31,11 +31,11 @@ from oslo_config import cfg
from oslo_utils import excutils from oslo_utils import excutils
from oslo_utils import units from oslo_utils import units
from ironic_lib.openstack.common._i18n import _
from ironic_lib.openstack.common._i18n import _LE
from ironic_lib.openstack.common._i18n import _LW
from ironic_lib.openstack.common import imageutils from ironic_lib.openstack.common import imageutils
from ironic_lib.common.i18n import _
from ironic_lib.common.i18n import _LE
from ironic_lib.common.i18n import _LW
from ironic_lib import disk_partitioner from ironic_lib import disk_partitioner
from ironic_lib import exception from ironic_lib import exception
from ironic_lib import utils from ironic_lib import utils

View File

@ -27,8 +27,8 @@ import six
from oslo_config import cfg from oslo_config import cfg
from ironic_lib.openstack.common._i18n import _ from ironic_lib.common.i18n import _
from ironic_lib.openstack.common._i18n import _LE from ironic_lib.common.i18n import _LE
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -27,9 +27,9 @@ from oslo_concurrency import processutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import excutils from oslo_utils import excutils
from ironic_lib.common.i18n import _LE
from ironic_lib.common.i18n import _LW
from ironic_lib import exception from ironic_lib import exception
from ironic_lib.openstack.common._i18n import _LE
from ironic_lib.openstack.common._i18n import _LW
utils_opts = [ utils_opts = [
cfg.StrOpt('rootwrap_config', cfg.StrOpt('rootwrap_config',

View File

@ -9,6 +9,7 @@ greenlet>=0.3.2
Jinja2>=2.6 # BSD License (3 clause) Jinja2>=2.6 # BSD License (3 clause)
oslo.concurrency>=2.3.0 # Apache-2.0 oslo.concurrency>=2.3.0 # Apache-2.0
oslo.config>=2.3.0 # Apache-2.0 oslo.config>=2.3.0 # Apache-2.0
oslo.i18n>=1.5.0 # Apache-2.0
oslo.middleware>=2.8.0 # Apache-2.0 oslo.middleware>=2.8.0 # Apache-2.0
oslo.serialization>=1.4.0 # Apache-2.0 oslo.serialization>=1.4.0 # Apache-2.0
oslo.service>=0.7.0 # Apache-2.0 oslo.service>=0.7.0 # Apache-2.0