Translate provider name when shown in song view

This commit is contained in:
craig.p.drummond
2013-11-28 19:55:25 +00:00
parent 2d7d3ed135
commit 4c1c8cc8a2
4 changed files with 12 additions and 5 deletions

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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

View File

@@ -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; }