Use parameters instead of concatenation in UI strings

Translations sometimes need to have different word order.
This commit is contained in:
Lasse Liehu 2015-08-29 12:17:35 +03:00
parent fb74751e32
commit 6ed837eaff
5 changed files with 5 additions and 5 deletions

View File

@ -256,7 +256,7 @@ Notification SnoreCore::getActiveNotificationByID(uint id) const
void SnoreCore::displayExapleNotification() void SnoreCore::displayExapleNotification()
{ {
Application app = SnoreCorePrivate::instance()->defaultApplication(); Application app = SnoreCorePrivate::instance()->defaultApplication();
QString text = QLatin1String("<i>") + tr("This is ") + app.name() + QLatin1String("</i><br>" QString text = QLatin1String("<i>") + tr("This is %1").arg(app.name()) + QLatin1String("</i><br>"
"<b>") + tr("Everything is awesome!") + QLatin1String("</b><br>"); "<b>") + tr("Everything is awesome!") + QLatin1String("</b><br>");
if (!app.constHints().value("use-markup").toBool()) { if (!app.constHints().value("use-markup").toBool()) {
text = Utils::normalizeMarkup(text, Utils::NO_MARKUP); text = Utils::normalizeMarkup(text, Utils::NO_MARKUP);

View File

@ -67,7 +67,7 @@ bool GrowlBackend::isReady()
{ {
bool running = Growl::isRunning(GROWL_TCP, settingsValue(QLatin1String("Host")).toString().toUtf8().constData()); bool running = Growl::isRunning(GROWL_TCP, settingsValue(QLatin1String("Host")).toString().toUtf8().constData());
if (!running) { if (!running) {
setErrorString(name() + tr(" is not running.")); setErrorString(tr("%1 is not running.").arg(name()));
} }
return running; return running;
} }

View File

@ -147,7 +147,7 @@ bool SnarlBackend::isReady()
{ {
bool running = SnarlInterface::IsSnarlRunning(); bool running = SnarlInterface::IsSnarlRunning();
if (!running) { if (!running) {
setErrorString(name() + tr(" is not running.")); setErrorString(tr("%1 is not running.").arg(name()));
} }
return running; return running;
} }

View File

@ -17,7 +17,7 @@ using namespace Snore;
bool SnoreToast::isReady() bool SnoreToast::isReady()
{ {
if (errorString().isEmpty() && QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS8) { if (errorString().isEmpty() && QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS8) {
setErrorString(name() + tr(" needs at least Windows 8 to run.")); setErrorString(tr("%1 needs at least Windows 8 to run.").arg(name()));
return false; return false;
} }
return true; return true;

View File

@ -49,7 +49,7 @@ SettingsWindow::SettingsWindow(const QString &appName, QWidget *parent) :
ui->comboBox->deleteLater(); ui->comboBox->deleteLater();
ui->label->deleteLater(); ui->label->deleteLater();
SnoreCorePrivate::instance()->setLocalSttingsPrefix(appName); SnoreCorePrivate::instance()->setLocalSttingsPrefix(appName);
setWindowTitle(appName + tr(" Settings")); setWindowTitle(tr("%1 Settings").arg(appName));
ui->widget->initTabs(); ui->widget->initTabs();
ui->widget->setVisible(true); ui->widget->setVisible(true);
} }