mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Allow to translate error messages
This commit is contained in:
parent
fcc87b4e9b
commit
2c23840947
4 changed files with 9 additions and 9 deletions
|
@ -4220,8 +4220,8 @@ void Session::startUpTorrents()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numOfRemappedFiles > 0) {
|
if (numOfRemappedFiles > 0) {
|
||||||
LogMsg(QString(tr("Queue positions were corrected in %1 resume files"))
|
LogMsg(tr("Queue positions were corrected in %1 resume files").arg(numOfRemappedFiles)
|
||||||
.arg(numOfRemappedFiles), Log::CRITICAL);
|
, Log::CRITICAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// starting up downloading torrents (queue position > 0)
|
// starting up downloading torrents (queue position > 0)
|
||||||
|
|
|
@ -296,7 +296,7 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder)
|
||||||
const QJsonObject valObj {val.toObject()};
|
const QJsonObject valObj {val.toObject()};
|
||||||
if (valObj.contains("url")) {
|
if (valObj.contains("url")) {
|
||||||
if (!valObj["url"].isString()) {
|
if (!valObj["url"].isString()) {
|
||||||
LogMsg(QString("Couldn't load RSS Feed '%1'. URL is required.")
|
LogMsg(tr("Couldn't load RSS Feed '%1'. URL is required.")
|
||||||
.arg(QString("%1\\%2").arg(folder->path(), key)), Log::WARNING);
|
.arg(QString("%1\\%2").arg(folder->path(), key)), Log::WARNING);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -305,13 +305,13 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder)
|
||||||
if (valObj.contains("uid")) {
|
if (valObj.contains("uid")) {
|
||||||
uid = QUuid {valObj["uid"].toString()};
|
uid = QUuid {valObj["uid"].toString()};
|
||||||
if (uid.isNull()) {
|
if (uid.isNull()) {
|
||||||
LogMsg(QString("Couldn't load RSS Feed '%1'. UID is invalid.")
|
LogMsg(tr("Couldn't load RSS Feed '%1'. UID is invalid.")
|
||||||
.arg(QString("%1\\%2").arg(folder->path(), key)), Log::WARNING);
|
.arg(QString("%1\\%2").arg(folder->path(), key)), Log::WARNING);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_feedsByUID.contains(uid)) {
|
if (m_feedsByUID.contains(uid)) {
|
||||||
LogMsg(QString("Duplicate RSS Feed UID: %1. Configuration seems to be corrupted.")
|
LogMsg(tr("Duplicate RSS Feed UID: %1. Configuration seems to be corrupted.")
|
||||||
.arg(uid.toString()), Log::WARNING);
|
.arg(uid.toString()), Log::WARNING);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LogMsg(QString("Couldn't load RSS Item '%1'. Invalid data format.")
|
LogMsg(tr("Couldn't load RSS Item '%1'. Invalid data format.")
|
||||||
.arg(QString("%1\\%2").arg(folder->path(), key)), Log::WARNING);
|
.arg(QString("%1\\%2").arg(folder->path(), key)), Log::WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ enum class APIErrorType
|
||||||
class APIError : public RuntimeError
|
class APIError : public RuntimeError
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit APIError(APIErrorType type, const QString &message = "");
|
explicit APIError(APIErrorType type, const QString &message = {});
|
||||||
|
|
||||||
APIErrorType type() const;
|
APIErrorType type() const;
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ void SearchController::startAction()
|
||||||
requireParams({"pattern", "category", "plugins"});
|
requireParams({"pattern", "category", "plugins"});
|
||||||
|
|
||||||
if (!Utils::ForeignApps::pythonInfo().isValid())
|
if (!Utils::ForeignApps::pythonInfo().isValid())
|
||||||
throw APIError(APIErrorType::Conflict, "Python must be installed to use the Search Engine.");
|
throw APIError(APIErrorType::Conflict, tr("Python must be installed to use the Search Engine."));
|
||||||
|
|
||||||
const QString pattern = params()["pattern"].trimmed();
|
const QString pattern = params()["pattern"].trimmed();
|
||||||
const QString category = params()["category"].trimmed();
|
const QString category = params()["category"].trimmed();
|
||||||
|
@ -89,7 +89,7 @@ void SearchController::startAction()
|
||||||
ISession *const session = sessionManager()->session();
|
ISession *const session = sessionManager()->session();
|
||||||
auto activeSearches = session->getData<QSet<int>>(ACTIVE_SEARCHES);
|
auto activeSearches = session->getData<QSet<int>>(ACTIVE_SEARCHES);
|
||||||
if (activeSearches.size() >= MAX_CONCURRENT_SEARCHES)
|
if (activeSearches.size() >= MAX_CONCURRENT_SEARCHES)
|
||||||
throw APIError(APIErrorType::Conflict, QString("Unable to create more than %1 concurrent searches.").arg(MAX_CONCURRENT_SEARCHES));
|
throw APIError(APIErrorType::Conflict, tr("Unable to create more than %1 concurrent searches.").arg(MAX_CONCURRENT_SEARCHES));
|
||||||
|
|
||||||
const auto id = generateSearchId();
|
const auto id = generateSearchId();
|
||||||
const SearchHandlerPtr searchHandler {SearchPluginManager::instance()->startSearch(pattern, category, pluginsToUse)};
|
const SearchHandlerPtr searchHandler {SearchPluginManager::instance()->startSearch(pattern, category, pluginsToUse)};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue