From 48f870633aeda21f7114990ca386e8733a265d41 Mon Sep 17 00:00:00 2001 From: Arvin Schnell Date: Thu, 27 Aug 2015 11:26:00 +0200 Subject: [PATCH] - improved translation message for plural form --- client/commands.cc | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/client/commands.cc b/client/commands.cc index 02df9ad6..908e44f0 100644 --- a/client/commands.cc +++ b/client/commands.cc @@ -20,9 +20,13 @@ */ +#include + #include "commands.h" #include "utils/text.h" -#include "misc.h" +#include "snapper/AppUtil.h" + +using namespace std; #define SERVICE "org.opensuse.Snapper" @@ -265,14 +269,13 @@ void command_delete_xsnapshots(DBus::Connection& conn, const string& config_name, const list& nums, bool verbose) { - DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "DeleteSnapshots"); - - DBus::Hoho hoho(call); - hoho << config_name << nums; + if (verbose) + { + cout << sformat(_("Deleting snapshot from %s:", "Deleting snapshots from %s:", nums.size()), + config_name.c_str()) << endl; - if (verbose) { - cout << _("Deleting snapshots from ") << config_name << ": "; - for (list::const_iterator it = nums.begin(); it != nums.end(); ++it) { + for (list::const_iterator it = nums.begin(); it != nums.end(); ++it) + { if (it != nums.begin()) cout << ", "; cout << *it; @@ -280,6 +283,11 @@ command_delete_xsnapshots(DBus::Connection& conn, const string& config_name, cout << endl; } + DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "DeleteSnapshots"); + + DBus::Hoho hoho(call); + hoho << config_name << nums; + conn.send_with_reply_and_block(call); } -- 2.47.3