i18n - Make string translatable

Since internationalization should be enabled in Watcher, this
patchset refactors the Watcher codebase to wrap previously
untranslatable strings with i18n translation functions so we can
import them for translation into the .pot template file.

Partially Implements: blueprint support-translation
Change-Id: I425967a60b5a7957f753894e5d2ba0d2c5009d1d
This commit is contained in:
Vincent Françoise
2015-12-14 17:27:55 +01:00
parent 3dd02ee895
commit ac07f35dc7
18 changed files with 743 additions and 541 deletions

View File

@@ -40,10 +40,9 @@ class AuthTokenMiddleware(auth_token.AuthProtocol):
self.public_api_routes = [re.compile(route_pattern_tpl % route_tpl)
for route_tpl in public_api_routes]
except re.error as e:
msg = _('Cannot compile public API routes: %s') % e
LOG.error(msg)
raise exception.ConfigInvalid(error_msg=msg)
LOG.exception(e)
raise exception.ConfigInvalid(
error_msg=_('Cannot compile public API routes'))
super(AuthTokenMiddleware, self).__init__(app, conf)