[virt-manager PATCH 2/9] i18n: improve title of connection dialog

Pino Toscano ptoscano at redhat.com
Thu Sep 17 06:43:59 UTC 2020


Instead of using the title of the dialog and prepending the connection
label, create a new title as a single string. This way it is possible to
translate this title as single sentence.

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

diff --git a/virtManager/host.py b/virtManager/host.py
index 59f78c7a..663b320d 100644
--- a/virtManager/host.py
+++ b/virtManager/host.py
@@ -35,8 +35,6 @@ class vmmHost(vmmGObjectUI):
         vmmGObjectUI.__init__(self, "host.ui", "vmm-host")
         self.conn = conn
 
-        self._orig_title = self.topwin.get_title()
-
         # Set default window size
         w, h = self.conn.get_details_window_size()
         if w <= 0:
@@ -177,7 +175,8 @@ class vmmHost(vmmGObjectUI):
         conn_active = self.conn.is_active()
 
         self.topwin.set_title(
-            self.conn.get_pretty_desc() + " " + self._orig_title)
+            _("%(connection)s - Connection Details") %
+            {"connection": self.conn.get_pretty_desc()})
         if not self.widget("overview-name").has_focus():
             self.widget("overview-name").set_text(self.conn.get_pretty_desc())
 
-- 
2.26.2




More information about the virt-tools-list mailing list