[virt-manager PATCH 18/21] i18n: improve label for redirector

Pino Toscano ptoscano at redhat.com
Mon Jul 13 08:25:56 UTC 2020


Use placeholders for the bus name, and the index; the latter is part of
the string, to avoid a string puzzle.
Also use vmmAddHardware.disk_pretty_bus() to get the proper translated
string of a bus.

Signed-off-by: Pino Toscano <ptoscano at redhat.com>
---
 virtManager/details/details.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/virtManager/details/details.py b/virtManager/details/details.py
index c44642d9..126018c7 100644
--- a/virtManager/details/details.py
+++ b/virtManager/details/details.py
@@ -229,8 +229,10 @@ def _label_for_device(dev):
         pretty = vmmGraphicsDetails.graphics_pretty_type_simple(dev.type)
         return _("Display %s") % pretty
     if devtype == "redirdev":
-        return (_("%s Redirector") % (dev.bus.upper()) +
-                (" %s" % (dev.get_xml_idx() + 1)))
+        return _("%(bus)s Redirector %(index)d") % {
+            "bus": vmmAddHardware.disk_pretty_bus(dev.bus),
+            "index": dev.get_xml_idx() + 1,
+        }
     if devtype == "hostdev":
         return vmmAddHardware.hostdev_pretty_name(dev)
     if devtype == "sound":
-- 
2.26.2




More information about the virt-tools-list mailing list