Enhance delayed message translation when _ is imported

Delayed message translation currently doesn't work for
messages written from files that import the _ function
directly.  For example:

from ceilometer.openstack.common.gettextutils import _

This change uses new support added to oslo that enables
lazy text translation in files where _ is imported
directly.

Implements bp user-locale-api

Change-Id: Ib2189836c6bbeb7e242a77415424fa77af5366f5
This commit is contained in:
Brad Pokorny 2013-08-20 18:41:26 +00:00
parent 56a87b10ed
commit b96d4e53f0

View File

@ -76,6 +76,7 @@ cfg.CONF.register_cli_opts(CLI_OPTIONS, group="service_credentials")
def prepare_service(argv=None):
eventlet.monkey_patch()
gettextutils.install('ceilometer', True)
gettextutils.enable_lazy()
rpc.set_defaults(control_exchange='ceilometer')
cfg.set_defaults(log.log_opts,
default_log_levels=['amqplib=WARN',