deb-cinder/cinder/i18n.py
Jay S Bryant 0ed1bae46f Remove unused gettextutils from oslo-incubator
Now that the old config generator code has been replaced/removed
we can now also remove gettextutils.  The generator was the last
hold-out in our code still using that obsolete code.

This patch removes the unneeded file and also updates the i18n code
that was monkey patching in support for using the _() and _LX()
functions in gettextutils.

Change-Id: Ib29915b13bd7f0173637ac6d1881f1ca06b713d6
related-bug: 1381563
2015-10-16 15:22:49 -05:00

51 lines
1.4 KiB
Python

# Copyright 2014 IBM Corp.
#
# 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 as i18n
DOMAIN = 'cinder'
_translators = i18n.TranslatorFactory(domain=DOMAIN)
# 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
def enable_lazy(enable=True):
return i18n.enable_lazy(enable)
def translate(value, user_locale=None):
return i18n.translate(value, user_locale)
def get_available_languages():
return i18n.get_available_languages(DOMAIN)