]> review.fuel-infra Code Review - openstack-build/heat-build.git/commit
Enable localizable REST API responses via the Accept-Language header
authorLuis A. Garcia <luis@linux.vnet.ibm.com>
Thu, 18 Jul 2013 00:49:49 +0000 (00:49 +0000)
committerLuis A. Garcia <luis@linux.vnet.ibm.com>
Sat, 3 Aug 2013 00:19:17 +0000 (00:19 +0000)
commit9004239b9ffc7d1ef6ae3393a8d500e1d822af4a
tree6c7dd692b3577d0f8e60b71f5bb82dea13ce5a90
parent0af1565a5eefc2f040e955c1654518c3367758c1
Enable localizable REST API responses via the Accept-Language header

Add support for doing language resolution for a request, based on the
Accept-Language HTTP header. Using the lazy gettext functionality, from
oslo gettextutils, it is possible to use the resolved language to
translate exception messages to the user requested language and
return that translation from the API.

The patch removes individually imported _() so they don't replace the
one installed service-wide.

Also, it adds the ability to fully re-create a remote error
with the same kwargs with which it was originally created, so that we
can translate it and show it to the user.

Partially implements bp user-locale-api.

Change-Id: I63edc8463836bfff257daa8a2c66ed5d3a444254
17 files changed:
bin/heat-api
bin/heat-api-cfn
bin/heat-api-cloudwatch
bin/heat-cfn
bin/heat-engine
bin/heat-manage
heat/api/middleware/fault.py
heat/api/openstack/v1/__init__.py
heat/api/openstack/v1/events.py
heat/api/openstack/v1/stacks.py
heat/api/openstack/v1/util.py
heat/common/exception.py
heat/common/wsgi.py
heat/openstack/common/exception.py
heat/openstack/common/rpc/common.py
heat/tests/test_api_openstack_v1.py
heat/tests/test_wsgi.py