[virt-manager PATCH 07/16] i18n: use single strings for connection/uri

Pino Toscano ptoscano at redhat.com
Tue Jul 14 07:41:51 UTC 2020


Create single strings for connection/uri hints & tooltips, so it is
easier to translate them, and there are not glued like puzzles.

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

diff --git a/virtManager/manager.py b/virtManager/manager.py
index 29d7fb80..c80af125 100644
--- a/virtManager/manager.py
+++ b/virtManager/manager.py
@@ -578,16 +578,16 @@ class vmmManager(vmmGObjectUI):
     def _build_conn_hint(self, conn):
         hint = conn.get_uri()
         if conn.is_disconnected():
-            hint += " (%s)" % _("Double click to connect")
+            hint = _("%(uri)s (Double click to connect)") % {"uri": conn.get_uri()}
         return hint
 
     def _build_conn_markup(self, conn, name):
         name = xmlutil.xml_escape(name)
         text = name
         if conn.is_disconnected():
-            text += " - " + _("Not Connected")
+            text = _("%(connection)s - Not Connected") % {"connection": name}
         elif conn.is_connecting():
-            text += " - " + _("Connecting...")
+            text = _("%(connection)s - Connecting...") % {"connection": name}
 
         markup = "<span size='smaller'>%s</span>" % text
         return markup
-- 
2.26.2




More information about the virt-tools-list mailing list