The doc string in exception.py of Keystone will be returned with __doc__ method, but cannot realize the internationalization.
/v2.0/tokens
{
"error": {
"message": "Expecting to find username or userId in passwordCredentials. The server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error.",
"code": 400,
"title": "Bad Request"
}
}
{
"error": {
"message": "The request you have made requires authentication.",
"code": 401,
"title": "Not Authorized"
}
}
{
"error": {
"message": "Invalid user / password",
"code": 401,
"title": "Not Authorized"
}
}
The message in error which should be translated is returned from the doc string in excetpion.py of Keystone.
in keystone exception.py, there are a lot of doc string which are used as REST API return messages, those doc string can't be translated to other language, because python doesn't support to directly translate the doc string in the program.Then those messages will be returned as hardcode, it doesn't make sense, since other REST API return messages can be translated,so I think we need modify the exception.py to support i18n