[virt-manager PATCH 12/21] i18n: avoid string puzzle in display autoport string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When updating the checkbox aobut the automatic port, set a full string
(without or with the port) instead of "cutting" an existing label.
Not only it avoids to manipulate a UI string, it also allows translators
to properly translate the whole string that includes a port.

Signed-off-by: Pino Toscano <ptoscano@xxxxxxxxxx>
---
 virtManager/device/gfxdetails.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/virtManager/device/gfxdetails.py b/virtManager/device/gfxdetails.py
index 23b8c994..5475de26 100644
--- a/virtManager/device/gfxdetails.py
+++ b/virtManager/device/gfxdetails.py
@@ -160,12 +160,12 @@ class vmmGraphicsDetails(vmmGObjectUI):
             auto = self.widget(basename + "-auto")
             widget = self.widget(basename)
             auto.set_inconsistent(False)
-            label = auto.get_label().split(" (")[0]
+            label = _("A_uto")
 
             if val == -1 or gfx.autoport:
                 auto.set_active(True)
                 if val and val != -1:
-                    label += " (%s %s)" % (_("Port"), val)
+                    label = _("A_uto (Port %(port)d)") % {"port": val}
             elif val is None:
                 auto.set_inconsistent(True)
             else:
-- 
2.26.2




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux