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

@@ -89,5 +89,5 @@ class ApplierManager(MessagingCore):
LOG.debug("type_event => %s" % str(event_type))
LOG.debug("data => %s" % str(data))
except Exception as e:
LOG.error("evt %s" % e.message)
raise e
LOG.exception(e)
raise

View File

@@ -20,7 +20,7 @@
from oslo_config import cfg
from watcher._i18n import _
from watcher.applier.primitives.base import BasePrimitive
from watcher.applier.primitives.wrapper.nova_wrapper import NovaWrapper
from watcher.applier.promise import Promise
@@ -70,7 +70,8 @@ class ChangeNovaServiceState(BasePrimitive):
def nova_manage_service(self, state):
if state is None:
raise IllegalArgumentException("The target state is not defined")
raise IllegalArgumentException(
_("The target state is not defined"))
keystone = KeystoneClient()
wrapper = NovaWrapper(keystone.get_credentials(),

View File

@@ -20,7 +20,6 @@ from oslo_config import cfg
from oslo_log import log
import oslo_messaging as om
from watcher.applier.manager import APPLIER_MANAGER_OPTS
from watcher.applier.manager import opt_group
from watcher.common import exception
@@ -69,5 +68,5 @@ class ApplierAPI(MessagingCore):
try:
pass
except Exception as e:
LOG.error("evt %s" % e.message)
raise e
LOG.exception(e)
raise