Add i18n translation to extenstions 1/3
This is 1 of 3 patches to add translation to the extensions directory and some other files. Custom hacking rules will be added later to enforce this style. Change-Id: Iddd738c2d9a7c9a57fcd445650d087123dbccfc4
This commit is contained in:
parent
4f9c538f68
commit
845851245a
@ -39,9 +39,9 @@ class Configurations(object):
|
||||
@staticmethod
|
||||
def load(context):
|
||||
if context is None:
|
||||
raise TypeError("Argument context not defined.")
|
||||
raise TypeError(_("Argument context not defined."))
|
||||
elif id is None:
|
||||
raise TypeError("Argument is not defined.")
|
||||
raise TypeError(_("Argument is not defined."))
|
||||
|
||||
if context.is_admin:
|
||||
db_info = DBConfiguration.find_all(deleted=False)
|
||||
|
@ -28,6 +28,7 @@ import six
|
||||
|
||||
from trove.common import cfg
|
||||
from trove.common import exception
|
||||
from trove.common.i18n import _
|
||||
from trove.dns import driver
|
||||
|
||||
|
||||
@ -83,7 +84,8 @@ class DesignateDriver(driver.DnsDriver):
|
||||
"""Creates the entry in the driver at the given dns zone."""
|
||||
dns_zone = entry.dns_zone or self.default_dns_zone
|
||||
if not dns_zone.id:
|
||||
raise TypeError("The entry's dns_zone must have an ID specified.")
|
||||
raise TypeError(_("The entry's dns_zone must have an ID "
|
||||
"specified."))
|
||||
name = entry.name
|
||||
LOG.debug("Creating DNS entry %s." % name)
|
||||
client = self.dns_client
|
||||
@ -125,16 +127,16 @@ class DesignateDriver(driver.DnsDriver):
|
||||
|
||||
def modify_content(self, name, content, dns_zone):
|
||||
# We dont need this in trove for now
|
||||
raise NotImplementedError("Not implemented for Designate DNS.")
|
||||
raise NotImplementedError(_("Not implemented for Designate DNS."))
|
||||
|
||||
def rename_entry(self, content, name, dns_zone):
|
||||
# We dont need this in trove for now
|
||||
raise NotImplementedError("Not implemented for Designate DNS.")
|
||||
raise NotImplementedError(_("Not implemented for Designate DNS."))
|
||||
|
||||
def _get_records(self, dns_zone):
|
||||
dns_zone = dns_zone or self.default_dns_zone
|
||||
if not dns_zone:
|
||||
raise TypeError('DNS domain is must be specified')
|
||||
raise TypeError(_('DNS domain is must be specified'))
|
||||
return self.dns_client.records.list(dns_zone.id)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user