Enable lazy translation for Cinder
This patch is the final step for getting lazy translation re-enabled for Cinder. It removes the use of gettextutils.install() which is no longer needed with the addition of the explicit import of _() in all of Cinder's files. The configuration of 'cinder' catalog is handled by gettextutils. The install() function is replaced by gettextutils.enable_lazy() which properly enables lazy translation when _() or _LX() is used. Change-Id: I79e705f3852e8aa34034015199d56a8b23aeb8ef Implements-Blueprint: i18n-enablement
This commit is contained in:
parent
eafcc41e82
commit
ce86dbaa96
@ -45,7 +45,7 @@ if os.path.exists(os.path.join(possible_topdir, "cinder", "__init__.py")):
|
||||
sys.path.insert(0, possible_topdir)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.install('cinder')
|
||||
gettextutils.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
|
@ -35,7 +35,7 @@ if os.path.exists(os.path.join(possible_topdir, "cinder", "__init__.py")):
|
||||
sys.path.insert(0, possible_topdir)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.install('cinder')
|
||||
gettextutils.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
|
@ -39,7 +39,7 @@ if os.path.exists(os.path.join(possible_topdir, 'cinder', '__init__.py')):
|
||||
sys.path.insert(0, possible_topdir)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.install('cinder')
|
||||
gettextutils.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
|
@ -38,7 +38,7 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'cinder', '__init__.py')):
|
||||
sys.path.insert(0, POSSIBLE_TOPDIR)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.install('cinder')
|
||||
gettextutils.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
|
@ -73,7 +73,7 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'cinder', '__init__.py')):
|
||||
sys.path.insert(0, POSSIBLE_TOPDIR)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.install('cinder')
|
||||
gettextutils.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
|
@ -22,6 +22,7 @@ import sys
|
||||
import rtslib
|
||||
|
||||
gettext.install('cinder-rtstool', unicode=1)
|
||||
gettext.enable_lazy()
|
||||
|
||||
|
||||
class RtstoolError(Exception):
|
||||
|
@ -39,7 +39,7 @@ if os.path.exists(os.path.join(possible_topdir, 'cinder', '__init__.py')):
|
||||
sys.path.insert(0, possible_topdir)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.install('cinder')
|
||||
gettextutils.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
|
@ -43,7 +43,7 @@ if os.path.exists(os.path.join(possible_topdir, 'cinder', '__init__.py')):
|
||||
sys.path.insert(0, possible_topdir)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.install('cinder')
|
||||
gettextutils.enable_lazy()
|
||||
|
||||
# Need to register global_opts
|
||||
from cinder.common import config # noqa
|
||||
|
@ -53,7 +53,7 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'cinder', '__init__.py')):
|
||||
sys.path.insert(0, POSSIBLE_TOPDIR)
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.install('cinder')
|
||||
gettextutils.enable_lazy()
|
||||
|
||||
from cinder import context
|
||||
from cinder import db
|
||||
|
@ -18,7 +18,7 @@ import os
|
||||
from oslo.config import cfg
|
||||
|
||||
from cinder.openstack.common import gettextutils
|
||||
gettextutils.install('cinder')
|
||||
gettextutils.enable_lazy()
|
||||
|
||||
from cinder.db.sqlalchemy import migrate_repo
|
||||
from cinder import version
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
import datetime
|
||||
|
||||
from cinder.openstack.common.gettextutils import _
|
||||
from cinder.openstack.common import log as logging
|
||||
from oslo.config import cfg
|
||||
from sqlalchemy import MetaData, Table
|
||||
|
Loading…
x
Reference in New Issue
Block a user