- fixed and added new texts
authorJan Kupec <jkupec@suse.cz>
Wed, 25 Jun 2008 12:27:47 +0000 (12:27 +0000)
committerJan Kupec <jkupec@suse.cz>
Wed, 25 Jun 2008 12:27:47 +0000 (12:27 +0000)
src/callbacks/locks.h
src/locks.cc

index 51572c2..fac1208 100644 (file)
@@ -17,15 +17,10 @@ namespace zypp {
   {
     virtual Action conflict( const PoolQuery& query, ConflictState state )
     {
-      //TODO localize
-      if (state==SAME_RESULTS)
-      {
-         Zypper::instance()->out().error("this query have lock same results as lock which you want remove:");
-      }
+      if (state == SAME_RESULTS)
+         Zypper::instance()->out().error("The following query locks the same packages as the lock which you want remove:");
       else
-      {
-         Zypper::instance()->out().error("this query lock some of objects, which you want unlock:");
-      }
+         Zypper::instance()->out().error(_("The following query locks some of the objects you want to unlock:"));
 
       query.serialize(std::cout);
 
@@ -38,7 +33,7 @@ namespace zypp {
   {
     virtual Action execute( const PoolQuery& query )
     {
-      Zypper::instance()->out().error("this query doesn't lock anything:");
+      Zypper::instance()->out().error(_("The following query does not lock anything:"));
 
       query.serialize(std::cout);
 
@@ -47,10 +42,9 @@ namespace zypp {
     }
   };
 
-
-
 }
 
+
 class LocksCallbacks {
   private:
     zypp::LocksSaveReportReceiver _saveReport;
index 55b6982..6a76c5b 100644 (file)
@@ -118,7 +118,6 @@ void add_locks(Zypper & zypper, const Zypper::ArgList & args, const ResKindSet &
   Locks::size_type start = 0;
   try
   {
-
     Locks & locks = Locks::instance();
     locks.read();
     start = locks.size();
@@ -155,7 +154,10 @@ void add_locks(Zypper & zypper, const Zypper::ArgList & args, const ResKindSet &
     zypper.setExitCode(ZYPPER_EXIT_ERR_ZYPP);
   }
   if ( start != Locks::instance().size() )
-    zypper.out().info(_("Specified lock(-s) has been successfully added."));
+    zypper.out().info(_PL(
+      "Specified lock has been successfully added.",
+      "Specified locks have been successfully added.",
+      Locks::instance().size() - start));
 }
 
 
@@ -222,14 +224,15 @@ void remove_locks(Zypper & zypper, const Zypper::ArgList & args)
 
     locks.save();
 
-    if (start==locks.size())
-    {
+    // nothing removed
+    if (start == locks.size())
       zypper.out().info("No lock has been removed.");
-      // nothing removed
-    } else {
-      zypper.out().info(str::form("Lock count has been succesfully decreased by: %lu",start-locks.size()));
-      //removed something
-    }
+    //removed something
+    else
+      zypper.out().info(str::form(_PL(
+        "%lu lock has been successfully removed.",
+        "%lu locks have been succesfully removed.",
+        start - locks.size()), start - locks.size()));
   }
   catch(const Exception & e)
   {