[virt-manager PATCH 02/21] i18n: improve labels for channels

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


Use separate string in case we have the channel name, and in case we
have the channel type.

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

diff --git a/virtManager/details/details.py b/virtManager/details/details.py
index 16c074e7..6e597694 100644
--- a/virtManager/details/details.py
+++ b/virtManager/details/details.py
@@ -213,13 +213,13 @@ def _label_for_device(dev):
         return label
 
     if devtype == "channel":
-        label = _("Channel")
         name = vmmAddHardware.char_pretty_channel_name(dev.target_name)
-        if not name:
-            name = vmmAddHardware.char_pretty_type(dev.type)
         if name:
-            label += " %s" % name
-        return label
+            return _("Channel %(name)s") % {"name": name}
+        pretty_type = vmmAddHardware.char_pretty_type(dev.type)
+        if pretty_type:
+            return _("Channel %(type)s") % {"type": pretty_type}
+        return _("Channel")
 
     if devtype == "graphics":
         pretty = vmmGraphicsDetails.graphics_pretty_type_simple(dev.type)
-- 
2.26.2




More information about the virt-tools-list mailing list