Browse Source

Merge pull request #8832 from Chocobo1/tr

Fix translations
adaptive-webui-19844
Mike Tzou 7 years ago committed by GitHub
parent
commit
7aa18dbb22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      src/base/bittorrent/torrenthandle.cpp
  2. 25
      src/base/search/searchpluginmanager.cpp
  3. 1
      src/base/search/searchpluginmanager.h
  4. 11
      src/gui/fspathedit.cpp

13
src/base/bittorrent/torrenthandle.cpp

@ -156,8 +156,6 @@ const int TorrentHandle::MAX_SEEDING_TIME = 525600; @@ -156,8 +156,6 @@ const int TorrentHandle::MAX_SEEDING_TIME = 525600;
// The following can be removed after one or two libtorrent releases on each branch.
namespace
{
const char i18nContext[] = "TorrentHandle";
// new constructor is available
template<typename T, typename std::enable_if<std::is_constructible<T, libt::torrent_info, bool>::value, int>::type = 0>
T makeTorrentCreator(const libtorrent::torrent_info & ti)
@ -1476,8 +1474,8 @@ void TorrentHandle::handleStorageMovedFailedAlert(libtorrent::storage_moved_fail @@ -1476,8 +1474,8 @@ void TorrentHandle::handleStorageMovedFailedAlert(libtorrent::storage_moved_fail
return;
}
LogMsg(QCoreApplication::translate(i18nContext, "Could not move torrent: '%1'. Reason: %2")
.arg(name(), QString::fromStdString(p->message())), Log::CRITICAL);
LogMsg(tr("Could not move torrent: '%1'. Reason: %2")
.arg(name(), QString::fromStdString(p->message())), Log::CRITICAL);
m_moveStorageInfo.newPath.clear();
if (!m_moveStorageInfo.queuedPath.isEmpty()) {
@ -1649,19 +1647,18 @@ void TorrentHandle::handleSaveResumeDataFailedAlert(libtorrent::save_resume_data @@ -1649,19 +1647,18 @@ void TorrentHandle::handleSaveResumeDataFailedAlert(libtorrent::save_resume_data
void TorrentHandle::handleFastResumeRejectedAlert(libtorrent::fastresume_rejected_alert *p)
{
qDebug("/!\\ Fast resume failed for %s, reason: %s", qUtf8Printable(name()), p->message().c_str());
Logger *const logger = Logger::instance();
updateStatus();
if (p->error.value() == libt::errors::mismatching_file_size) {
// Mismatching file size (files were probably moved)
logger->addMessage(QCoreApplication::translate(i18nContext, "File sizes mismatch for torrent '%1', pausing it.").arg(name()), Log::CRITICAL);
LogMsg(tr("File sizes mismatch for torrent '%1', pausing it.").arg(name()), Log::CRITICAL);
m_hasMissingFiles = true;
if (!isPaused())
pause();
}
else {
logger->addMessage(QCoreApplication::translate(i18nContext, "Fast resume data was rejected for torrent '%1'. Reason: %2. Checking again...")
.arg(name(), QString::fromStdString(p->message())), Log::CRITICAL);
LogMsg(tr("Fast resume data was rejected for torrent '%1'. Reason: %2. Checking again...")
.arg(name(), QString::fromStdString(p->message())), Log::CRITICAL);
}
}

25
src/base/search/searchpluginmanager.cpp

@ -62,18 +62,6 @@ namespace @@ -62,18 +62,6 @@ namespace
QPointer<SearchPluginManager> SearchPluginManager::m_instance = nullptr;
const QHash<QString, QString> SearchPluginManager::m_categoryNames {
{"all", QT_TRANSLATE_NOOP("SearchEngine", "All categories")},
{"movies", QT_TRANSLATE_NOOP("SearchEngine", "Movies")},
{"tv", QT_TRANSLATE_NOOP("SearchEngine", "TV shows")},
{"music", QT_TRANSLATE_NOOP("SearchEngine", "Music")},
{"games", QT_TRANSLATE_NOOP("SearchEngine", "Games")},
{"anime", QT_TRANSLATE_NOOP("SearchEngine", "Anime")},
{"software", QT_TRANSLATE_NOOP("SearchEngine", "Software")},
{"pictures", QT_TRANSLATE_NOOP("SearchEngine", "Pictures")},
{"books", QT_TRANSLATE_NOOP("SearchEngine", "Books")}
};
SearchPluginManager::SearchPluginManager()
: m_updateUrl(QString("http://searchplugins.qbittorrent.org/%1/engines/").arg(Utils::Misc::pythonVersion() >= 3 ? "nova3" : "nova"))
{
@ -307,7 +295,18 @@ SearchHandler *SearchPluginManager::startSearch(const QString &pattern, const QS @@ -307,7 +295,18 @@ SearchHandler *SearchPluginManager::startSearch(const QString &pattern, const QS
QString SearchPluginManager::categoryFullName(const QString &categoryName)
{
return tr(m_categoryNames.value(categoryName).toUtf8().constData());
static const QHash<QString, QString> categoryTable {
{"all", tr("All categories")},
{"movies", tr("Movies")},
{"tv", tr("TV shows")},
{"music", tr("Music")},
{"games", tr("Games")},
{"anime", tr("Anime")},
{"software", tr("Software")},
{"pictures", tr("Pictures")},
{"books", tr("Books")}
};
return categoryTable.value(categoryName);
}
QString SearchPluginManager::pluginFullName(const QString &pluginName)

1
src/base/search/searchpluginmanager.h

@ -111,7 +111,6 @@ private: @@ -111,7 +111,6 @@ private:
static QString pluginPath(const QString &name);
static QPointer<SearchPluginManager> m_instance;
static const QHash<QString, QString> m_categoryNames;
const QString m_updateUrl;

11
src/gui/fspathedit.cpp

@ -41,7 +41,6 @@ @@ -41,7 +41,6 @@
namespace
{
const char i18nContext[] = "FileSystemPathEdit";
struct TrStringWithComment
{
const char *source;
@ -49,18 +48,18 @@ namespace @@ -49,18 +48,18 @@ namespace
QString tr() const
{
return QCoreApplication::translate(i18nContext, source, comment);
return QCoreApplication::translate("FileSystemPathEdit", source, comment);
}
};
constexpr TrStringWithComment browseButtonBriefText =
QT_TRANSLATE_NOOP3(i18nContext, "...", "Launch file dialog button text (brief)");
QT_TRANSLATE_NOOP3("FileSystemPathEdit", "...", "Launch file dialog button text (brief)");
constexpr TrStringWithComment browseButtonFullText =
QT_TRANSLATE_NOOP3(i18nContext, "&Browse...", "Launch file dialog button text (full)");
QT_TRANSLATE_NOOP3("FileSystemPathEdit", "&Browse...", "Launch file dialog button text (full)");
constexpr TrStringWithComment defaultDialogCaptionForFile =
QT_TRANSLATE_NOOP3(i18nContext, "Choose a file", "Caption for file open/save dialog");
QT_TRANSLATE_NOOP3("FileSystemPathEdit", "Choose a file", "Caption for file open/save dialog");
constexpr TrStringWithComment defaultDialogCaptionForDirectory =
QT_TRANSLATE_NOOP3(i18nContext, "Choose a folder", "Caption for directory open dialog");
QT_TRANSLATE_NOOP3("FileSystemPathEdit", "Choose a folder", "Caption for directory open dialog");
}
class FileSystemPathEdit::FileSystemPathEditPrivate

Loading…
Cancel
Save