Mark more UI strings as translatable

This commit is contained in:
Cole Robinson 2015-09-23 16:28:46 -04:00
parent 601a82cb87
commit 2f775b6bf0
3 changed files with 16 additions and 12 deletions

View File

@ -261,12 +261,12 @@ class vmmCreate(vmmGObjectUI):
self.widget("install-box").hide()
self.widget("arch-expander").hide()
self.widget("startup-error").set_text("Error: %s" % error)
self.widget("startup-error").set_text("%s: %s" % (_("Error"), error))
return False
def _show_startup_warning(self, error):
self.widget("startup-error-box").show()
self.widget("startup-error").set_text("Warning: %s" % error)
self.widget("startup-error").set_text("%s: %s" % (_("Warning"), error))
def _init_state(self):

View File

@ -207,7 +207,6 @@ def _label_for_device(dev):
label = _("Parallel")
elif devtype == "console":
label = _("Console")
label = devtype.capitalize()
if dev.target_port is not None:
label += " %s" % (int(dev.target_port) + 1)
return label
@ -2428,14 +2427,17 @@ class vmmDetails(vmmGObjectUI):
apps_model.append([name, version, summary])
def refresh_stats_page(self):
def _multi_color(text1, text2):
return ('<span color="#82003B"></span> '
'<span color="#295C45"></span>' % (text1, text2))
def _dsk_rx_tx_text(rx, tx, unit):
return ('<span color="#82003B">%(rx)d %(unit)s read</span> '
'<span color="#295C45">%(tx)d %(unit)s write</span>' %
{"rx": rx, "tx": tx, "unit": unit})
opts = {"received": rx, "transfered": tx, "units": unit}
return _multi_color(_("%(received)d %(units)s read") % opts,
_("%(transfered)d %(units)s write") % opts)
def _net_rx_tx_text(rx, tx, unit):
return ('<span color="#82003B">%(rx)d %(unit)s in</span> '
'<span color="#295C45">%(tx)d %(unit)s out</span>' %
{"rx": rx, "tx": tx, "unit": unit})
opts = {"received": rx, "transfered": tx, "units": unit}
return _multi_color(_("%(received)d %(units)s in") % opts,
_("%(transfered)d %(units)s out") % opts)
cpu_txt = _("Disabled")
mem_txt = _("Disabled")
@ -2448,8 +2450,10 @@ class vmmDetails(vmmGObjectUI):
if self.config.get_stats_enable_memory_poll():
cur_vm_memory = self.vm.stats_memory()
vm_memory = self.vm.maximum_memory()
mem_txt = "%s of %s" % (util.pretty_mem(cur_vm_memory),
util.pretty_mem(vm_memory))
mem_txt = _("%(current-memory) of %(total-memory)") % {
"current-memory": util.pretty_mem(cur_vm_memory),
"total-memory": util.pretty_mem(vm_memory)
}
if self.config.get_stats_enable_disk_poll():
dsk_txt = _dsk_rx_tx_text(self.vm.disk_read_rate(),

View File

@ -41,7 +41,7 @@ class VirtualController(VirtualDevice):
def pretty_type(ctype):
pretty_mappings = {
VirtualController.TYPE_IDE : "IDE",
VirtualController.TYPE_FDC : "Floppy",
VirtualController.TYPE_FDC : _("Floppy"),
VirtualController.TYPE_SCSI : "SCSI",
VirtualController.TYPE_SATA : "SATA",
VirtualController.TYPE_VIRTIOSERIAL : "VirtIO Serial",