From 8aaedbe74184effd950d4485a6d67a4b26b1c674 Mon Sep 17 00:00:00 2001 From: Jan Kupec Date: Wed, 25 Jun 2008 12:27:47 +0000 Subject: [PATCH] - fixed and added new texts --- src/callbacks/locks.h | 16 +++++----------- src/locks.cc | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/callbacks/locks.h b/src/callbacks/locks.h index 51572c2..fac1208 100644 --- a/src/callbacks/locks.h +++ b/src/callbacks/locks.h @@ -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; diff --git a/src/locks.cc b/src/locks.cc index 55b6982..6a76c5b 100644 --- a/src/locks.cc +++ b/src/locks.cc @@ -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) { -- 2.7.4