[PATCH] virt-host-validate: Improve translatability of messages printed by 'virHostMsgCheck()'

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

 



Move the word 'Checking' into the appropriate formatting strings and
mark all outstanding ones for translation.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/637
Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tools/virt-host-validate-bhyve.c  |  2 +-
 tools/virt-host-validate-ch.c     |  2 +-
 tools/virt-host-validate-common.c | 18 +++++++++---------
 tools/virt-host-validate-qemu.c   |  4 ++--
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/tools/virt-host-validate-bhyve.c b/tools/virt-host-validate-bhyve.c
index db1cdd8e2c..adb5ae1717 100644
--- a/tools/virt-host-validate-bhyve.c
+++ b/tools/virt-host-validate-bhyve.c
@@ -28,7 +28,7 @@
 #include "virt-host-validate-common.h"

 #define MODULE_STATUS(mod, err_msg, err_code) \
-    virHostMsgCheck("BHYVE", _("for %1$s module"), #mod); \
+    virHostMsgCheck("BHYVE", _("Checking for %1$s module"), #mod); \
     if (mod ## _loaded) { \
         virHostMsgPass(); \
     } else { \
diff --git a/tools/virt-host-validate-ch.c b/tools/virt-host-validate-ch.c
index 9d235ed7ab..3f96423836 100644
--- a/tools/virt-host-validate-ch.c
+++ b/tools/virt-host-validate-ch.c
@@ -57,7 +57,7 @@ int virHostValidateCh(void)
     }

     if (hasVirtFlag) {
-        virHostMsgCheck("CH", "%s", _("for hardware virtualization"));
+        virHostMsgCheck("CH", "%s", _("Checking for hardware virtualization"));
         if (hasHwVirt) {
             virHostMsgPass();
         } else {
diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c
index c8a23e2e99..58d8dbbaa1 100644
--- a/tools/virt-host-validate-common.c
+++ b/tools/virt-host-validate-common.c
@@ -66,7 +66,7 @@ void virHostMsgCheck(const char *prefix,
     msg = g_strdup_vprintf(format, args);
     va_end(args);

-    fprintf(stdout, _("%1$6s: Checking %2$-60s: "), prefix, msg);
+    fprintf(stdout, "%1$6s: %2$-60s: ", prefix, msg);
 }

 static bool virHostMsgWantEscape(void)
@@ -137,7 +137,7 @@ int virHostValidateDeviceExists(const char *hvname,
                                 virHostValidateLevel level,
                                 const char *hint)
 {
-    virHostMsgCheck(hvname, "if device %s exists", dev_name);
+    virHostMsgCheck(hvname, _("Checking if device '%1$s' exists"), dev_name);

     if (access(dev_name, F_OK) < 0) {
         virHostMsgFail(level, "%s", hint);
@@ -154,7 +154,7 @@ int virHostValidateDeviceAccessible(const char *hvname,
                                     virHostValidateLevel level,
                                     const char *hint)
 {
-    virHostMsgCheck(hvname, "if device %s is accessible", dev_name);
+    virHostMsgCheck(hvname, _("Checking if device '%1$s' is accessible"), dev_name);

     if (access(dev_name, R_OK|W_OK) < 0) {
         virHostMsgFail(level, "%s", hint);
@@ -173,7 +173,7 @@ int virHostValidateNamespace(const char *hvname,
 {
     char nspath[100];

-    virHostMsgCheck(hvname, "for namespace %s", ns_name);
+    virHostMsgCheck(hvname, _("Checking for namespace '%1$s'"), ns_name);

     g_snprintf(nspath, sizeof(nspath), "/proc/self/ns/%s", ns_name);

@@ -256,7 +256,7 @@ int virHostValidateLinuxKernel(const char *hvname,

     uname(&uts);

-    virHostMsgCheck(hvname, _("for Linux >= %1$d.%2$d.%3$d"),
+    virHostMsgCheck(hvname, _("Checking for Linux >= %1$d.%2$d.%3$d"),
                     ((version >> 16) & 0xff),
                     ((version >> 8) & 0xff),
                     (version & 0xff));
@@ -302,7 +302,7 @@ int virHostValidateCGroupControllers(const char *hvname,
         if (!(controllers & flag))
             continue;

-        virHostMsgCheck(hvname, "for cgroup '%s' controller support", cg_name);
+        virHostMsgCheck(hvname, _("Checking for cgroup '%1$s' controller support"), cg_name);

         if (!virCgroupHasController(group, i)) {
             ret = VIR_HOST_VALIDATE_FAILURE(level);
@@ -337,7 +337,7 @@ int virHostValidateIOMMU(const char *hvname,
     struct dirent *dent;
     int rc;

-    virHostMsgCheck(hvname, "%s", _("for device assignment IOMMU support"));
+    virHostMsgCheck(hvname, "%s", _("Checking for device assignment IOMMU support"));

     flags = virHostValidateGetCPUFlags();

@@ -423,7 +423,7 @@ int virHostValidateIOMMU(const char *hvname,
     if (!S_ISDIR(sb.st_mode))
         return 0;

-    virHostMsgCheck(hvname, "%s", _("if IOMMU is enabled by kernel"));
+    virHostMsgCheck(hvname, "%s", _("Checking if IOMMU is enabled by kernel"));
     if (sb.st_nlink <= 2) {
         if (bootarg)
             virHostMsgFail(level,
@@ -483,7 +483,7 @@ int virHostValidateSecureGuests(const char *hvname,
     else if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SEV))
         hasAMDSev = true;

-    virHostMsgCheck(hvname, "%s", _("for secure guest support"));
+    virHostMsgCheck(hvname, "%s", _("Checking for secure guest support"));
     if (ARCH_IS_S390(arch)) {
         if (hasFac158) {
             if (!virFileIsDir("/sys/firmware/uv")) {
diff --git a/tools/virt-host-validate-qemu.c b/tools/virt-host-validate-qemu.c
index 3eeee516d3..b685fa01ba 100644
--- a/tools/virt-host-validate-qemu.c
+++ b/tools/virt-host-validate-qemu.c
@@ -64,7 +64,7 @@ int virHostValidateQEMU(void)
     }

     if (hasVirtFlag) {
-        virHostMsgCheck("QEMU", "%s", _("for hardware virtualization"));
+        virHostMsgCheck("QEMU", "%s", _("Checking for hardware virtualization"));
         if (hasHwVirt) {
             virHostMsgPass();
         } else {
@@ -86,7 +86,7 @@ int virHostValidateQEMU(void)
     }

     if (arch == VIR_ARCH_PPC64 || arch == VIR_ARCH_PPC64LE) {
-        virHostMsgCheck("QEMU", "%s", _("for PowerPC KVM module loaded"));
+        virHostMsgCheck("QEMU", "%s", _("Checking for PowerPC KVM module loaded"));

         if (!virHostKernelModuleIsLoaded("kvm_hv"))
             virHostMsgFail(VIR_HOST_VALIDATE_WARN,
-- 
2.45.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux