mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-06 15:04:34 +08:00
Allow to translate error messages
This commit is contained in:
parent
fcc87b4e9b
commit
2c23840947
@ -4220,8 +4220,8 @@ void Session::startUpTorrents()
|
||||
}
|
||||
|
||||
if (numOfRemappedFiles > 0) {
|
||||
LogMsg(QString(tr("Queue positions were corrected in %1 resume files"))
|
||||
.arg(numOfRemappedFiles), Log::CRITICAL);
|
||||
LogMsg(tr("Queue positions were corrected in %1 resume files").arg(numOfRemappedFiles)
|
||||
, Log::CRITICAL);
|
||||
}
|
||||
|
||||
// starting up downloading torrents (queue position > 0)
|
||||
|
@ -296,7 +296,7 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder)
|
||||
const QJsonObject valObj {val.toObject()};
|
||||
if (valObj.contains("url")) {
|
||||
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);
|
||||
continue;
|
||||
}
|
||||
@ -305,13 +305,13 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder)
|
||||
if (valObj.contains("uid")) {
|
||||
uid = QUuid {valObj["uid"].toString()};
|
||||
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);
|
||||
continue;
|
||||
}
|
||||
|
||||
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);
|
||||
continue;
|
||||
}
|
||||
@ -329,7 +329,7 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder)
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ enum class APIErrorType
|
||||
class APIError : public RuntimeError
|
||||
{
|
||||
public:
|
||||
explicit APIError(APIErrorType type, const QString &message = "");
|
||||
explicit APIError(APIErrorType type, const QString &message = {});
|
||||
|
||||
APIErrorType type() const;
|
||||
|
||||
|
@ -66,7 +66,7 @@ void SearchController::startAction()
|
||||
requireParams({"pattern", "category", "plugins"});
|
||||
|
||||
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 category = params()["category"].trimmed();
|
||||
@ -89,7 +89,7 @@ void SearchController::startAction()
|
||||
ISession *const session = sessionManager()->session();
|
||||
auto activeSearches = session->getData<QSet<int>>(ACTIVE_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 SearchHandlerPtr searchHandler {SearchPluginManager::instance()->startSearch(pattern, category, pluginsToUse)};
|
||||
|
Loading…
Reference in New Issue
Block a user