diff options
author | Brant Knudson <bknudson@us.ibm.com> | 2014-10-27 10:54:48 -0500 |
---|---|---|
committer | Jamie Lennox <jamielennox@redhat.com> | 2014-10-28 20:33:19 +0000 |
commit | fece74ca3e56342bee43f561404c19128a613628 (patch) | |
tree | 7241c8dcb7f3176da3df660dbfb5006f9eb86fc1 /keystoneclient/base.py | |
parent | 3b766c51438396a0ab0032de309c9d56e275e0cb (diff) | |
download | python-keystoneclient-fece74ca3e56342bee43f561404c19128a613628.tar.gz |
I18n
Keystoneclient didn't provide translated messages. With this
change, the messages are marked for translation.
DocImpact
Implements: blueprint keystoneclient-i18n
Change-Id: I85263a71671a1dffed524185266e6bb7ae559630
Diffstat (limited to 'keystoneclient/base.py')
-rw-r--r-- | keystoneclient/base.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/keystoneclient/base.py b/keystoneclient/base.py index 2571a37..030afef 100644 --- a/keystoneclient/base.py +++ b/keystoneclient/base.py @@ -27,6 +27,7 @@ from six.moves import urllib from keystoneclient import auth from keystoneclient import exceptions +from keystoneclient.i18n import _ from keystoneclient.openstack.common.apiclient import base @@ -219,7 +220,7 @@ class Manager(object): management=management, **kwargs) except KeyError: - raise exceptions.ClientException("Invalid update method: %s" + raise exceptions.ClientException(_("Invalid update method: %s") % method) # PUT requests may not return a body if body: @@ -244,7 +245,8 @@ class ManagerWithFind(Manager): num = len(rl) if num == 0: - msg = "No %s matching %s." % (self.resource_class.__name__, kwargs) + msg = _("No %(name)s matching %(kwargs)s.") % { + 'name': self.resource_class.__name__, 'kwargs': kwargs} raise exceptions.NotFound(404, msg) elif num > 1: raise exceptions.NoUniqueMatch @@ -395,7 +397,8 @@ class CrudManager(Manager): num = len(rl) if num == 0: - msg = "No %s matching %s." % (self.resource_class.__name__, kwargs) + msg = _("No %(name)s matching %(kwargs)s.") % { + 'name': self.resource_class.__name__, 'kwargs': kwargs} raise exceptions.NotFound(404, msg) elif num > 1: raise exceptions.NoUniqueMatch |