Browse Source

Fix translation strings not found

The translation context doesn't exist, so the translations were not found, fixed
now.
Closes #8829.
adaptive-webui-19844
Chocobo1 7 years ago
parent
commit
d20f40184f
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 25
      src/base/search/searchpluginmanager.cpp
  2. 1
      src/base/search/searchpluginmanager.h

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;

Loading…
Cancel
Save