Fix translated response

When request has ``Accept-Language`` header, keystone should response
the translated message. Without oslo_i18n lazy translation feature, the
message will be translated before the server knows the language.

Actually this has been fixed previously, like
2167e3612c

But seems the logic was broken after i18n refactor.

Change-Id: Icb3d9dcd25a5dde0676fc4bd4eaad7b265a0c99d
This commit is contained in:
Shengjing Zhu 2019-08-19 14:49:37 +08:00
parent 7aa97f1712
commit 6abd44500f
1 changed files with 2 additions and 0 deletions

View File

@ -21,6 +21,8 @@ See https://docs.openstack.org/oslo.i18n/latest/user/usage.html .
import oslo_i18n
oslo_i18n.enable_lazy()
_translators = oslo_i18n.TranslatorFactory(domain='keystone')
# The primary translation function using the well-known name "_"