User Locales for API Messages
I18N/l10n support for API Messages based on the client locale
Current Nova API messages are fixed to the locale of Host OS. However, clients from various countries will use the API, so API messages should be changed based on the locale of the client request. User locale can be determined from the Accept-Language header per request, or retrieved from the user or tenant records in Keystone, using the authentication context for the request.
related to https:/
A related blueprint in oslo-incubator will hold the general Messaging functionality for porting to other projects. https:/
Blueprint information
- Status:
- Complete
- Approver:
- Vish Ishaya
- Priority:
- Low
- Drafter:
- Mathew Odden
- Direction:
- Approved
- Assignee:
- Mathew Odden
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
-
Good progress
- Milestone target:
- None
- Started by
- Thierry Carrez
- Completed by
- John Garbutt
Related branches
Related bugs
Sprints
Whiteboard
The current implementation under review uses WebOb's Accept-Language functionality for parsing and determining the response to send back any translatable error messages from the APIs. WeBob parses the Accept-Language header according to BCP47 (http://
Essentially what this comes down to is: if we have a corresponding .MO file (compiled gettext message format) for that language, we use that in our list of available languages that is sent to WeBob to make a best match determination based on the Accept-Language string. If there is no match or we do not detect any .MO files, it will always default to 'en_US', since that is our always available language. Only error messages from the API are translated, since normally responses coming from the API are data responses.
Gerrit topic: https:/
Addressed by: https:/
Add support for API message localization
Addressed by: https:/
Sync oslo-incubator gettextutils
Addressed by: https:/
Sync gettextutils from oslo
Addressed by: https:/
Sync gettextutils from oslo-incubator
Addressed by: https:/
Fix typo in exception message
---
Unfortunately, this was disabled late in the havana cycle. See https:/
Work Items
Work items:
Pull in oslo-incubator delayed translation functionality: DONE
Add support to use Accept-Language languages for translate-able responses: INPROGRESS