Commit 867254f0 authored by Lukas Appelhans's avatar Lukas Appelhans

Okay more translations and stuff

parent e9e1c7ac
......@@ -18,6 +18,7 @@
#include <akabeioperationrunner.h>
#include <kdebug.h>
#include <kio/global.h>
#include <qcoreapplication.h>
RemoveOperation::RemoveOperation(QObject * parent)
: QObject(parent)
......@@ -142,4 +143,5 @@ void RemoveOperation::finished()
{
QTextStream out(stdout);
out << "The transaction finished!" << endl;
QCoreApplication::instance()->quit();
}
......@@ -77,7 +77,7 @@ void SyncOperation::start(QList<APM::Operation> operations, QMultiHash<APM::Oper
if (AkabeiClient::Backend::instance()->databases().isEmpty())
return;
QTextStream out(stdout);
out << tr("Starting database update") << endl;
out << i18n("Starting database update") << endl;
foreach (AkabeiClient::DatabaseHandler* db, AkabeiClient::Backend::instance()->databases()) {
if (db->name().length() > m_maxDbNameLenght)
m_maxDbNameLenght = db->name().length();
......@@ -120,24 +120,24 @@ void SyncOperation::install(QUuid , QList< Akabei::Package* > packages)
return;
if (local.count() >= 1) {
if (local.count() > 1) {
out << "The following packages were already installed on your system:";
out << i18n("The following packages were already installed on your system:");
foreach (Akabei::Package* pkg, local.values()) {
out << " " << pkg->name() << " (" << pkg->version().toByteArray().data() << ")";
if (pkg != local.values().last())
out << ",";
}
out << "." << endl;
out << "Do you want to reinstall them?[y/n]";
out << i18n("Do you want to reinstall them?[y/n]");
} else {
out << "The package " << local.values().first()->name() << " (" << local.values().first()->version().toByteArray().data() << ") is already installed." << endl;
out << "Do you want to reinstall it?[y/n]";
out << i18n("The package %1 (%2) is already installed.", local.values().first()->name(), local.values().first()->version().toByteArray().data()) << endl;
out << i18n("Do you want to reinstall it?[y/n]");
}
out.flush();
std::string input;
getline(std::cin, input);
out << QLatin1String(input.c_str()) << endl;
if (input != "y")
if (input != i18n("y").toStdString())
return;
}
kDebug() << "Let's do this";
......@@ -165,16 +165,13 @@ void SyncOperation::validationFinished(bool valid)
{
QTextStream out(stdout);
if (!valid) {
foreach (Akabei::Operation * op, Akabei::Backend::instance()->operationRunner()->operations()) {
//kDebug() << op->fileSystemRemovals();
}
out << "Queue not valid" << endl;
out << i18n("The transaction could not be validated") << endl;
out.flush();
return;
}
int downloadSize = 0;
int installSize = 0;
out << "Packages: ";
out << i18n("Packages: ");
foreach (AkabeiClient::QueueItem * item, AkabeiClient::Backend::instance()->queue()->items()) {
if (item != AkabeiClient::Backend::instance()->queue()->items().first())
out << ", ";
......@@ -192,11 +189,11 @@ void SyncOperation::validationFinished(bool valid)
}
}
out << endl << endl;
out << "Download size: " << KIO::convertSize(downloadSize) << endl;
out << "Installed size: " << KIO::convertSize(installSize) << endl;
out << i18n("Download size: %1", KIO::convertSize(downloadSize)) << endl;
out << i18n("Installed size: %1", KIO::convertSize(installSize)) << endl;
out.flush();
out << "Continue with installation?[y/n]";
out << i18n("Continue with installation?[y/n]");
out.flush();
//std::string input;
//getline(std::cin, input);
......@@ -232,14 +229,19 @@ void SyncOperation::showProgress(int progress)
void SyncOperation::finished()
{
QTextStream out(stdout);
out << "The transaction finished!" << endl;
if (Akabei::Backend::instance()->operationRunner()->errors().isEmpty()) {
out << i18n("The transaction finished successfully!") << endl;
} else {
out << i18np("There has been an error during the transaction.", "There have been errors during the transaction.", Akabei::Backend::instance()->operationRunner()->errors().count());
}
QCoreApplication::instance()->quit();
}
void SyncOperation::errors(QList<Akabei::Error*>& errors)
{
kDebug() << "yoyoyo";
QTextStream out(stdout);
out << "Errors occurred: " << endl;
out << i18n("Errors occurred: ") << endl;
foreach (Akabei::Error * err, errors) {
out << err->description() << endl;
}
......@@ -392,7 +394,7 @@ void SyncOperation::updateNextDatabase()
{
if (m_currentDatabasePos == AkabeiClient::Backend::instance()->databases().count()) {
QTextStream out(stdout);
out << tr("Updating all databases finished") << endl;
out << i18n("Updating all databases finished") << endl;
QList<APM::Operation> opts = m_operations;
opts.removeAll(APM::UpdateDatabases);
start(opts, m_options, m_args);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment