From 8fbb985a8c7581a81b85bd4824f56707321a6b25 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Thu, 17 Sep 2020 08:43:59 +0200 Subject: [PATCH] i18n: improve title of connection dialog 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 --- tests/uitests/lib/app.py | 2 +- tests/uitests/test_cli.py | 2 +- tests/uitests/test_host.py | 2 +- ui/host.ui | 2 +- virtManager/host.py | 5 ++--- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/uitests/lib/app.py b/tests/uitests/lib/app.py index 814657318..2d6e13c00 100644 --- a/tests/uitests/lib/app.py +++ b/tests/uitests/lib/app.py @@ -53,7 +53,7 @@ class VMMDogtailApp(object): self.root.find_fuzzy("Edit", "menu").click() self.root.find_fuzzy("Connection Details", "menu item").click() win = self.root.find_fuzzy( - "%s Connection Details" % conn_label, "frame") + "%s - Connection Details" % conn_label, "frame") win.find_fuzzy(tab, "page tab").click() return win diff --git a/tests/uitests/test_cli.py b/tests/uitests/test_cli.py index 0f397806e..dcb40d7b6 100644 --- a/tests/uitests/test_cli.py +++ b/tests/uitests/test_cli.py @@ -24,7 +24,7 @@ class VMMCLI(lib.testcase.UITestCase): def testShowHost(self): self.app.open(extra_opts=["--show-host-summary"]) - lib.utils.check(lambda: self.app.topwin.name == "test testdriver.xml Connection Details") + lib.utils.check(lambda: self.app.topwin.name == "test testdriver.xml - Connection Details") nametext = self.app.topwin.find_fuzzy("Name:", "text") lib.utils.check(lambda: nametext.text == "test testdriver.xml") self.app.topwin.keyCombo("F4") diff --git a/tests/uitests/test_host.py b/tests/uitests/test_host.py index ddc8c6375..b4cd30193 100644 --- a/tests/uitests/test_host.py +++ b/tests/uitests/test_host.py @@ -166,7 +166,7 @@ class Host(lib.testcase.UITestCase): # Change the name, verify that title bar changed win.find("Name:", "text").set_text("FOOBAR") - self.app.root.find("FOOBAR Connection Details", "frame") + self.app.root.find("FOOBAR - Connection Details", "frame") # Open the manager window win.find("File", "menu").click() diff --git a/ui/host.ui b/ui/host.ui index a331f6422..5c14d6f90 100644 --- a/ui/host.ui +++ b/ui/host.ui @@ -7,7 +7,7 @@ 800 600 False - Connection Details + Connection Details 750 500 diff --git a/virtManager/host.py b/virtManager/host.py index 59f78c7ae..663b320df 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())