Adds local i18n translators
Adds oslo.i18n in requirements.txt Fixes i18n imports in local modules.
This commit is contained in:
parent
9433b9b6fb
commit
ee0aff001d
38
oslo_windows/_i18n.py
Normal file
38
oslo_windows/_i18n.py
Normal file
@ -0,0 +1,38 @@
|
||||
# Copyright 2015 Cloudbase Solutions Srl
|
||||
# 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.
|
||||
|
||||
"""oslo.i18n integration module.
|
||||
|
||||
See http://docs.openstack.org/developer/oslo.i18n/usage.html .
|
||||
|
||||
"""
|
||||
|
||||
import oslo_i18n
|
||||
|
||||
|
||||
_translators = oslo_i18n.TranslatorFactory(domain='oslo.windows')
|
||||
|
||||
# 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
|
@ -31,7 +31,7 @@ if sys.platform == 'win32':
|
||||
from oslo_log import log as logging
|
||||
|
||||
from nova import block_device
|
||||
from nova.i18n import _LI
|
||||
from oslo_windows._i18n import _LI
|
||||
from nova.virt import driver
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -20,7 +20,7 @@ import sys
|
||||
if sys.platform == 'win32':
|
||||
import wmi
|
||||
|
||||
from nova.i18n import _
|
||||
from oslo_windows._i18n import _
|
||||
from nova.virt.hyperv import constants
|
||||
|
||||
|
||||
|
@ -19,7 +19,7 @@ import os
|
||||
from eventlet import patcher
|
||||
from oslo_log import log as logging
|
||||
|
||||
from nova.i18n import _LE
|
||||
from oslo_windows._i18n import _LE
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -21,7 +21,7 @@ if sys.platform == 'win32':
|
||||
from oslo_log import log as logging
|
||||
|
||||
from nova import exception
|
||||
from nova.i18n import _, _LE
|
||||
from oslo_windows._i18n import _, _LE
|
||||
from nova.virt.hyperv import vmutils
|
||||
from nova.virt.hyperv import vmutilsv2
|
||||
from nova.virt.hyperv import volumeutilsv2
|
||||
|
@ -23,7 +23,7 @@ import uuid
|
||||
if sys.platform == 'win32':
|
||||
import wmi
|
||||
|
||||
from nova.i18n import _
|
||||
from oslo_windows._i18n import _
|
||||
from nova.virt.hyperv import vmutils
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@ import sys
|
||||
if sys.platform == 'win32':
|
||||
import wmi
|
||||
|
||||
from nova.i18n import _
|
||||
from oslo_windows._i18n import _
|
||||
from nova.virt.hyperv import networkutils
|
||||
from nova.virt.hyperv import vmutils
|
||||
|
||||
|
@ -24,7 +24,7 @@ if sys.platform == 'win32':
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from nova.i18n import _
|
||||
from oslo_windows._i18n import _
|
||||
from nova import utils
|
||||
from nova.virt.hyperv import constants
|
||||
from nova.virt.hyperv import vmutils
|
||||
|
@ -31,7 +31,7 @@ if sys.platform == 'win32':
|
||||
|
||||
from xml.etree import ElementTree
|
||||
|
||||
from nova.i18n import _
|
||||
from oslo_windows._i18n import _
|
||||
from nova.virt.hyperv import constants
|
||||
from nova.virt.hyperv import vmutils
|
||||
|
||||
|
@ -28,7 +28,7 @@ from xml.etree import ElementTree
|
||||
|
||||
from oslo_utils import units
|
||||
|
||||
from nova.i18n import _
|
||||
from oslo_windows._i18n import _
|
||||
from nova.virt.hyperv import constants
|
||||
from nova.virt.hyperv import vhdutils
|
||||
from nova.virt.hyperv import vmutils
|
||||
|
@ -32,7 +32,7 @@ import six
|
||||
from six.moves import range
|
||||
|
||||
from nova import exception
|
||||
from nova.i18n import _, _LW
|
||||
from oslo_windows._i18n import _, _LW
|
||||
from nova.virt.hyperv import constants
|
||||
from nova.virt.hyperv import hostutils
|
||||
|
||||
|
@ -30,7 +30,7 @@ from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from six.moves import range
|
||||
|
||||
from nova.i18n import _
|
||||
from oslo_windows._i18n import _
|
||||
from nova import utils
|
||||
from nova.virt.hyperv import basevolumeutils
|
||||
from nova.virt.hyperv import vmutils
|
||||
|
@ -28,7 +28,7 @@ from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from six.moves import range
|
||||
|
||||
from nova.i18n import _
|
||||
from oslo_windows._i18n import _
|
||||
from nova import utils
|
||||
from nova.virt.hyperv import basevolumeutils
|
||||
from nova.virt.hyperv import vmutils
|
||||
|
@ -16,7 +16,7 @@
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from nova.i18n import _
|
||||
from oslo_windows._i18n import _
|
||||
from nova.virt.hyperv import hostutils
|
||||
from nova.virt.hyperv import hostutilsv2
|
||||
from nova.virt.hyperv import livemigrationutils
|
||||
|
@ -3,3 +3,5 @@
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
Babel>=1.3
|
||||
|
||||
oslo.i18n>=1.5.0 # Apache-2.0
|
||||
|
Loading…
Reference in New Issue
Block a user