[virt-manager PATCH 19/21] i18n: improve vmmAddHardware.disk_pretty_bus
Pino Toscano
ptoscano at redhat.com
Mon Jul 13 08:25:57 UTC 2020
Use a static mapping of translated strings, instead of manipulating the
string.
Signed-off-by: Pino Toscano <ptoscano at redhat.com>
---
virtManager/addhardware.py | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 5d966655..b29e696e 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -529,13 +529,16 @@ class vmmAddHardware(vmmGObjectUI):
@staticmethod
def disk_pretty_bus(bus):
- if bus in ["ide", "sata", "scsi", "usb", "sd"]:
- return bus.upper()
- if bus in ["xen"]:
- return bus.capitalize()
- if bus == "virtio":
- return "VirtIO"
- return bus
+ bus_mappings = {
+ "ide": _("IDE"),
+ "sata": _("SATA"),
+ "scsi": _("SCSI"),
+ "sd": _("SD"),
+ "usb": _("USB"),
+ "virtio": _("VirtIO"),
+ "xen": _("Xen"),
+ }
+ return bus_mappings.get(bus, bus)
@staticmethod
def tpm_pretty_type(tpm_type):
--
2.26.2
More information about the virt-tools-list
mailing list