From ef4d9224f38ada2619a9578f6a6387af2fdd9e4a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Thu, 24 May 2012 23:00:26 +0200 Subject: [PATCH] Fix i18n calls --- src/clipproperties.cpp | 2 +- src/customtrackview.cpp | 2 +- src/effectstack/effectstackview2.cpp | 8 ++++---- src/kdenlivedoc.cpp | 2 +- src/mainwindow.cpp | 16 ++++++++-------- src/scopes/audioscopes/audiospectrum.cpp | 2 +- src/scopes/audioscopes/spectrogram.cpp | 8 ++++---- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/clipproperties.cpp b/src/clipproperties.cpp index b448d453..d1d610aa 100644 --- a/src/clipproperties.cpp +++ b/src/clipproperties.cpp @@ -230,7 +230,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg m_proxyContainer = new QFrame(); m_proxyContainer->setFrameShape(QFrame::NoFrame); QHBoxLayout *l = new QHBoxLayout; - l->addWidget(new QLabel(i18n("Proxy clip: %1").arg(KIO::convertSize(f.size())))); + l->addWidget(new QLabel(i18n("Proxy clip: %1", KIO::convertSize(f.size())))); l->addStretch(5); QPushButton *pb = new QPushButton(i18n("Delete proxy")); l->addWidget(pb); diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index 2f08b8e7..b4c14fcf 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -6252,7 +6252,7 @@ void CustomTrackView::alignAudio() if (counter == 0) { emit displayMessage(i18n("No audio clips selected."), ErrorMessage); } else { - emit displayMessage(i18n("Auto-aligned %1 clips.").arg(counter), InformationMessage); + emit displayMessage(i18n("Auto-aligned %1 clips.", counter), InformationMessage); } } diff --git a/src/effectstack/effectstackview2.cpp b/src/effectstack/effectstackview2.cpp index 9baa8435..dfec8f79 100644 --- a/src/effectstack/effectstackview2.cpp +++ b/src/effectstack/effectstackview2.cpp @@ -103,12 +103,12 @@ void EffectStackView2::slotClipItemSelected(ClipItem* c) if (c) { QString cname = m_clipref->clipName(); if (cname.length() > 30) { - m_ui.checkAll->setToolTip(i18n("Effects for %1").arg(cname)); + m_ui.checkAll->setToolTip(i18n("Effects for %1", cname)); cname.truncate(27); - m_ui.checkAll->setText(i18n("Effects for %1").arg(cname) + "..."); + m_ui.checkAll->setText(i18n("Effects for %1", cname) + "..."); } else { m_ui.checkAll->setToolTip(QString()); - m_ui.checkAll->setText(i18n("Effects for %1").arg(cname)); + m_ui.checkAll->setText(i18n("Effects for %1", cname)); } m_ui.checkAll->setEnabled(true); QString size = c->baseClip()->getProperty("frame_size"); @@ -140,7 +140,7 @@ void EffectStackView2::slotTrackItemSelected(int ix, const TrackInfo info) m_trackInfo = info; setEnabled(true); m_ui.checkAll->setToolTip(QString()); - m_ui.checkAll->setText(i18n("Effects for track %1").arg(info.trackName.isEmpty() ? QString::number(ix) : info.trackName)); + m_ui.checkAll->setText(i18n("Effects for track %1", info.trackName.isEmpty() ? QString::number(ix) : info.trackName)); m_ui.checkAll->setEnabled(true); m_trackindex = ix; setupListView(); diff --git a/src/kdenlivedoc.cpp b/src/kdenlivedoc.cpp index bd8335de..1e3e5865 100644 --- a/src/kdenlivedoc.cpp +++ b/src/kdenlivedoc.cpp @@ -798,7 +798,7 @@ void KdenliveDoc::setProjectFolder(KUrl url) KStandardDirs::makeDir(url.path()); KStandardDirs::makeDir(url.path(KUrl::AddTrailingSlash) + "titles/"); KStandardDirs::makeDir(url.path(KUrl::AddTrailingSlash) + "thumbs/"); - if (KMessageBox::questionYesNo(kapp->activeWindow(), i18n("You have changed the project folder. Do you want to copy the cached data from %1 to the new folder %2?").arg(m_projectFolder.path(), url.path())) == KMessageBox::Yes) moveProjectData(url); + if (KMessageBox::questionYesNo(kapp->activeWindow(), i18n("You have changed the project folder. Do you want to copy the cached data from %1 to the new folder %2?", m_projectFolder.path(), url.path())) == KMessageBox::Yes) moveProjectData(url); m_projectFolder = url; updateProjectFolderPlacesEntry(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3bcb4b79..eb4c6cfb 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -399,11 +399,11 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & KActionCategory *layoutActions = new KActionCategory(i18n("Layouts"), actionCollection()); m_loadLayout = new KSelectAction(i18n("Load Layout"), actionCollection()); for (int i = 1; i < 5; i++) { - KAction *load = new KAction(KIcon(), i18n("Layout %1").arg(i), this); + KAction *load = new KAction(KIcon(), i18n("Layout %1", i), this); load->setData("_" + QString::number(i)); layoutActions->addAction("load_layout" + QString::number(i), load); m_loadLayout->addAction(load); - KAction *save = new KAction(KIcon(), i18n("Save As Layout %1").arg(i), this); + KAction *save = new KAction(KIcon(), i18n("Save As Layout %1", i), this); save->setData("_" + QString::number(i)); layoutActions->addAction("save_layout" + QString::number(i), save); } @@ -698,7 +698,7 @@ bool MainWindow::queryClose() if (m_activeDocument->url().fileName().isEmpty()) message = i18n("Save changes to document?"); else - message = i18n("The project \"%1\" has been changed.\nDo you want to save your changes?").arg(m_activeDocument->url().fileName()); + message = i18n("The project \"%1\" has been changed.\nDo you want to save your changes?", m_activeDocument->url().fileName()); switch (KMessageBox::warningYesNoCancel(this, message)) { case KMessageBox::Yes : // save document here. If saving fails, return false; @@ -1736,7 +1736,7 @@ void MainWindow::loadLayouts() } for (int j = 0; j < saveActions.count(); j++) { if (saveActions.at(j)->data().toString().endsWith("_" + QString::number(i))) { - saveActions[j]->setText(i18n("Save as %1").arg(layoutName)); + saveActions[j]->setText(i18n("Save as %1", layoutName)); saveActions[j]->setData(key); break; } @@ -1919,7 +1919,7 @@ bool MainWindow::closeCurrentDocument(bool saveChanges) if (m_activeDocument->url().fileName().isEmpty()) message = i18n("Save changes to document?"); else - message = i18n("The project \"%1\" has been changed.\nDo you want to save your changes?").arg(m_activeDocument->url().fileName()); + message = i18n("The project \"%1\" has been changed.\nDo you want to save your changes?", m_activeDocument->url().fileName()); switch (KMessageBox::warningYesNoCancel(this, message)) { case KMessageBox::Yes : // save document here. If saving fails, return false; @@ -3108,7 +3108,7 @@ void MainWindow::slotAddVideoEffect(QAction *result) else effect = customEffects.getEffectByTag(info.at(0), info.at(1)); if (!effect.isNull()) slotAddEffect(effect); - else m_messageLabel->setMessage(i18n("Cannot find effect %1 / %2").arg(info.at(0)).arg(info.at(1)), ErrorMessage); + else m_messageLabel->setMessage(i18n("Cannot find effect %1 / %2", info.at(0), info.at(1)), ErrorMessage); } @@ -4108,12 +4108,12 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS // Do save scenelist QFile file(playlistPath); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { - m_messageLabel->setMessage(i18n("Cannot write to file %1").arg(playlistPath), ErrorMessage); + m_messageLabel->setMessage(i18n("Cannot write to file %1", playlistPath), ErrorMessage); return; } file.write(playlistContent.toUtf8()); if (file.error() != QFile::NoError) { - m_messageLabel->setMessage(i18n("Cannot write to file %1").arg(playlistPath), ErrorMessage); + m_messageLabel->setMessage(i18n("Cannot write to file %1", playlistPath), ErrorMessage); file.close(); return; } diff --git a/src/scopes/audioscopes/audiospectrum.cpp b/src/scopes/audioscopes/audiospectrum.cpp index 05a1fb90..10ac5f34 100644 --- a/src/scopes/audioscopes/audiospectrum.cpp +++ b/src/scopes/audioscopes/audiospectrum.cpp @@ -384,7 +384,7 @@ QImage AudioSpectrum::renderHUD(uint) } else { x = leftDist + m_innerScopeRect.width(); davinci.drawLine(x, topDist, x, topDist + m_innerScopeRect.height()+6); - davinci.drawText(x-10, y, i18n("%1 kHz").arg((double)m_freqMax/1000, 0, 'f', 1)); + davinci.drawText(x-10, y, i18n("%1 kHz", QString("%1").arg((double)m_freqMax/1000, 0, 'f', 1))); } if (hz > 0) { diff --git a/src/scopes/audioscopes/spectrogram.cpp b/src/scopes/audioscopes/spectrogram.cpp index bf06833c..e8674a3f 100644 --- a/src/scopes/audioscopes/spectrogram.cpp +++ b/src/scopes/audioscopes/spectrogram.cpp @@ -260,7 +260,7 @@ QImage Spectrogram::renderHUD(uint) && mouseX < m_innerScopeRect.width() && mouseX >= 0; davinci.drawLine(x, topDist, x, topDist + m_innerScopeRect.height()+6); if (!hideText) { - davinci.drawText(x-10, y, i18n("%1 kHz").arg((double)m_freqMax/1000, 0, 'f', 1)); + davinci.drawText(x-10, y, i18n("%1 kHz", QString("%1").arg((double)m_freqMax/1000, 0, 'f', 1))); } } @@ -269,8 +269,8 @@ QImage Spectrogram::renderHUD(uint) davinci.setPen(AbstractScopeWidget::penThin); x = leftDist + mouseX; davinci.drawLine(x, topDist, x, topDist + m_innerScopeRect.height()+6); - davinci.drawText(x-10, y, i18n("%1 kHz") - .arg((double)(m_mousePos.x()-m_innerScopeRect.left())/m_innerScopeRect.width() * m_freqMax/1000, 0, 'f', 2)); + davinci.drawText(x-10, y, i18n("%1 kHz", QString("%1") + .arg((double)(m_mousePos.x()-m_innerScopeRect.left())/m_innerScopeRect.width() * m_freqMax/1000, 0, 'f', 2))); } // Draw the dB brightness scale @@ -426,7 +426,7 @@ QImage Spectrogram::renderAudioScope(uint, const QVector audioFrame, co for (QList< QVector >::iterator it = m_fftHistory.begin(); it != m_fftHistory.end(); it++) { storedBytes += (*it).size() * sizeof((*it)[0]); } - qDebug() << QString("Total storage used: %1 kB").arg((double)storedBytes/1000, 0, 'f', 2); + qDebug() << QString("Total storage used: %1 kB", QString("%1").arg((double)storedBytes/1000, 0, 'f', 2)); #endif m_fftHistoryImg = spectrum; -- 2.39.2