{
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);
{
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);
}
};
-
-
}
+
class LocksCallbacks {
private:
zypp::LocksSaveReportReceiver _saveReport;
Locks::size_type start = 0;
try
{
-
Locks & locks = Locks::instance();
locks.read();
start = locks.size();
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));
}
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)
{