Enable lazy translation
This change makes it so that if the user makes a request with an Accept-Language header and the response is an error where the message is translatable, then the message will be translated to the requested language (or the most appropriate language available). completes bp user-locale-api Change-Id: I5b0b02e0459a6a444baa12f8722adb829b7e152b
This commit is contained in:
+1
-1
@@ -40,7 +40,7 @@ from keystone.openstack.common import gettextutils
|
||||
# NOTE(blk-u):
|
||||
# gettextutils.install() must run to set _ before importing any modules that
|
||||
# contain static translated strings.
|
||||
gettextutils.install('keystone')
|
||||
gettextutils.install('keystone', lazy=True)
|
||||
|
||||
from keystone.common import dependency
|
||||
from keystone.common import environment
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ from keystone.openstack.common import gettextutils
|
||||
|
||||
# NOTE(blk-u): gettextutils.install() must run to set _ before importing any
|
||||
# modules that contain static translated strings.
|
||||
gettextutils.install('keystone')
|
||||
gettextutils.install('keystone', lazy=True)
|
||||
|
||||
from keystone import cli
|
||||
from keystone.common import environment
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ from keystone.openstack.common import gettextutils
|
||||
# NOTE(blk-u):
|
||||
# gettextutils.install() must run to set _ before importing any modules that
|
||||
# contain static translated strings.
|
||||
gettextutils.install('keystone')
|
||||
gettextutils.install('keystone', lazy=True)
|
||||
|
||||
from keystone.common import dependency
|
||||
from keystone.common import environment
|
||||
|
||||
@@ -21,7 +21,7 @@ from wsgiref import simple_server
|
||||
from keystone.openstack.common import gettextutils
|
||||
|
||||
PROJECT = 'kds'
|
||||
gettextutils.install(PROJECT)
|
||||
gettextutils.install(PROJECT, lazy=True)
|
||||
|
||||
from keystone.contrib.kds.api import app
|
||||
from keystone.contrib.kds.common import service
|
||||
|
||||
Reference in New Issue
Block a user