Support Accept-Language for API messages

Registered by Mathew Odden

This blueprint has been superseded. See the newer blueprint "i18n Message improvements" for updated plans.

Currently, error messages coming back from the API are translated using the same locale as the system the Glance 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

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Mathew Odden
Direction:
Needs approval
Assignee:
None
Definition:
Superseded
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Mark Washenberger

Related branches

Sprints

Whiteboard

Example of where messages are being translated in the Glance API to the system local:
https://github.com/openstack/glance/blob/master/glance/api/v2/image_data.py#L64

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

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

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

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

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

Addressed by: https://review.openstack.org/40885
    Preserve Exception Message objects

It still seems like we might need something like this feature, but those reviews look like they met resistance and were abandoned. Is there a new approach we are hoping to try?
markwash more-info 2014-02-15

(?)

Work Items

Work items:
Integrate common gettext utilities for delayed translations from oslo-incubator: TODO
Implement support Accept-Language header support and API layer translations: TODO

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.