[virt-manager PATCH 08/21] i18n: improve labels for TPM

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


Use separate strings for the path case, and for the generic case (i.e.
the version), to avoid string puzzles.

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

diff --git a/virtManager/details/details.py b/virtManager/details/details.py
index dcc8a370..224f36b1 100644
--- a/virtManager/details/details.py
+++ b/virtManager/details/details.py
@@ -247,12 +247,9 @@ def _label_for_device(dev):
             return _("RNG %(device)s") % {"device": dev.device}
         return _("RNG")
     if devtype == "tpm":
-        label = _("TPM")
         if dev.device_path:
-            label += (" %s" % dev.device_path)
-        else:
-            label += (" v%s" % dev.version)
-        return label
+            return _("TPM %(device)s") % {"device": dev.device_path}
+        return _("TPM v%(version)s") % {"version": dev.version}
 
     devmap = {
         "panic": _("Panic Notifier"),
-- 
2.26.2




More information about the virt-tools-list mailing list