Translate provider name when shown in song view
This commit is contained in:
@@ -62,10 +62,7 @@ void LyricSettings::showEvent(QShowEvent *e)
|
||||
selected->clear();
|
||||
foreach (const UltimateLyricsProvider *provider, lprov) {
|
||||
QListWidgetItem *item = new QListWidgetItem(provider->isEnabled() ? selected : available);
|
||||
QString name(provider->getName());
|
||||
name.replace("(POLISH)", i18n("(Polish Translations)"));
|
||||
name.replace("(PORTUGUESE)", i18n("(Portuguese Translations)"));
|
||||
item->setText(name);
|
||||
item->setText(provider->displayName());
|
||||
item->setData(Qt::UserRole, provider->getName());
|
||||
}
|
||||
loadedXml=true;
|
||||
|
||||
@@ -459,7 +459,7 @@ void SongView::getLyrics()
|
||||
{
|
||||
currentProv=UltimateLyrics::self()->getNext(currentProvider);
|
||||
if (currentProv) {
|
||||
text->setText(i18n("Fetching lyrics via %1", currentProv->getName()));
|
||||
text->setText(i18n("Fetching lyrics via %1", currentProv->displayName()));
|
||||
currentProv->fetchInfo(currentRequest, currentSong);
|
||||
showSpinner();
|
||||
} else {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "ultimatelyricsprovider.h"
|
||||
#include "networkaccessmanager.h"
|
||||
#include "localize.h"
|
||||
#include <QTextCodec>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QUrl>
|
||||
@@ -178,6 +179,14 @@ UltimateLyricsProvider::~UltimateLyricsProvider()
|
||||
abort();
|
||||
}
|
||||
|
||||
QString UltimateLyricsProvider::displayName() const
|
||||
{
|
||||
QString n(name);
|
||||
n.replace("(POLISH)", i18n("(Polish Translations)"));
|
||||
n.replace("(PORTUGUESE)", i18n("(Portuguese Translations)"));
|
||||
return n;
|
||||
}
|
||||
|
||||
void UltimateLyricsProvider::fetchInfo(int id, const Song &metadata)
|
||||
{
|
||||
#if QT_VERSION < 0x050000
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
void addExcludeRule(const Rule &rule) { excludeRules << rule; }
|
||||
void addInvalidIndicator(const QString &indicator) { invalidIndicators << indicator; }
|
||||
QString getName() const { return name; }
|
||||
QString displayName() const;
|
||||
int getRelevance() const { return relevance; }
|
||||
void fetchInfo(int id, const Song &metadata);
|
||||
bool isEnabled() const { return enabled; }
|
||||
|
||||
Reference in New Issue
Block a user