Browse Source

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
changes/17/677117/1
Shengjing Zhu 2 years ago
parent
commit
6abd44500f
  1. 2
      keystone/i18n.py

2
keystone/i18n.py

@ -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 "_"

Loading…
Cancel
Save