Support Accept-Language for API messages

Registered by Mathew Odden

Currently, error messages coming back from the API are translated using the same locale as the system the Cinder API is running on. Ideally, we would like to have the messages translated to the request senders locale, which we can support using the HTTP Accept-Language header to determine before sending back the translated response. Alternatively, there is the possibility of using the tenant/user data from Keystone to store a preferred locale.

There is a similar blueprint for Nova that can be used to track the implementation work there:
https://blueprints.launchpad.net/nova/+spec/user-locale-api

Most of the work in Oslo and Nova should be easily transferable to the Cinder API.

Blueprint information

Status:
Complete
Approver:
John Griffith
Priority:
Low
Drafter:
Mathew Odden
Direction:
Approved
Assignee:
Luis A. Garcia
Definition:
Obsolete
Series goal:
None
Implementation:
Good progress
Milestone target:
milestone icon next
Started by
Mathew Odden
Completed by
Sean McGinnis

Related branches

Sprints

Whiteboard

(smcginnis): Marking obsolete as this has been sitting out there for a long time. If this is still needed, please submit a new bp.

Gerrit topic: https://review.openstack.org/#q,topic:bp/user-locale-api,n,z

Addressed by: https://review.openstack.org/36488
    Externalize error messages in the API

Addressed by: https://review.openstack.org/36345
    Sync gettextutils from oslo

Addressed by: https://review.openstack.org/36346
    Add support for API message localization

Addressed by: https://review.openstack.org/40035
    Add common methods required to allow translation of REST API responses

---

Unfortunately, this was disabled late in the havana cycle. See https://etherpad.openstack.org/disable-lazy-translation

(?)

Work Items

Work items:
Integrate common gettext utilities for delayed translations from oslo-incubator: DONE
Implement support Accept-Language header support and API layer translations: TODO
Add translatable error messages for API exceptions that did not have one: TODO

This blueprint contains Public information 
Everyone can see this information.