]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: avoid i18n puzzle
authorPino Toscano <ptoscano@redhat.com>
Wed, 24 Aug 2016 14:14:24 +0000 (16:14 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 24 Aug 2016 15:43:29 +0000 (17:43 +0200)
Use the full versions of the message, instead of composing a base
message with what was updated; the change makes the messages properly
translatable, since different parts of a sentence might need different
declensions for example.

tools/virsh-network.c

index 16980411f35fa44d39d6d1ee1852a8aad0c3bdd2..eec7faf7b8909f8b28450be68f3a7bf8a36fa850 100644 (file)
@@ -907,7 +907,6 @@ cmdNetworkUpdate(vshControl *ctl, const vshCmd *cmd)
     bool config = vshCommandOptBool(cmd, "config");
     bool live = vshCommandOptBool(cmd, "live");
     unsigned int flags = VIR_NETWORK_UPDATE_AFFECT_CURRENT;
-    const char *affected;
 
     VSH_EXCLUSIVE_OPTIONS("current", "live");
     VSH_EXCLUSIVE_OPTIONS("current", "config");
@@ -978,19 +977,22 @@ cmdNetworkUpdate(vshControl *ctl, const vshCmd *cmd)
 
     if (config) {
         if (live)
-            affected = _("persistent config and live state");
+            vshPrint(ctl, _("Updated network %s persistent config and live state"),
+                     virNetworkGetName(network));
         else
-            affected = _("persistent config");
+            vshPrint(ctl, _("Updated network %s persistent config"),
+                     virNetworkGetName(network));
     } else if (live) {
-            affected = _("live state");
+        vshPrint(ctl, _("Updated network %s live state"),
+                 virNetworkGetName(network));
     } else if (virNetworkIsActive(network)) {
-        affected = _("live state");
+        vshPrint(ctl, _("Updated network %s live state"),
+                 virNetworkGetName(network));
     } else {
-        affected = _("persistent config");
+        vshPrint(ctl, _("Updated network %s persistent config"),
+                 virNetworkGetName(network));
     }
 
-    vshPrint(ctl, _("Updated network %s %s"),
-             virNetworkGetName(network), affected);
     ret = true;
  cleanup:
     vshReportError(ctl);