diff --git a/context/songview.cpp b/context/songview.cpp index 9a9496488..406094f98 100644 --- a/context/songview.cpp +++ b/context/songview.cpp @@ -413,7 +413,7 @@ void SongView::getLyrics() { UltimateLyricsProvider *prov=UltimateLyrics::self()->getNext(currentProvider); if (prov) { - text->setText(i18n("Fetching lyrics via %1").arg(prov->getName())); + text->setText(i18n("Fetching lyrics via %1", prov->getName())); prov->fetchInfo(currentRequest, currentSong); showSpinner(); } else { diff --git a/devices/actiondialog.cpp b/devices/actiondialog.cpp index 50f2d28af..a5429ed97 100644 --- a/devices/actiondialog.cpp +++ b/devices/actiondialog.cpp @@ -185,7 +185,7 @@ void ActionDialog::updateSongCountLabel() albums.insert(s.albumArtist()+"--"+s.album); } - songCount->setText(i18n("Artists:%1, Albums:%2, Songs:%3").arg(artists.count()).arg(albums.count()).arg(songsToAction.count())); + songCount->setText(i18n("Artists:%1, Albums:%2, Songs:%3", artists.count(), albums.count(), songsToAction.count())); } void ActionDialog::controlInfoLabel() @@ -237,7 +237,7 @@ void ActionDialog::copy(const QString &srcUdi, const QString &dstUdi, const QLis FreeSpaceInfo inf=FreeSpaceInfo(MPDConnection::self()->getDetails().dir); spaceAvailable=inf.size()-inf.used(); usedCapacity=(inf.used()*1.0)/(inf.size()*1.0); - capacityString=i18n("%1 free").arg(Utils::formatByteSize(inf.size()-inf.used())); + capacityString=i18n("%1 free", Utils::formatByteSize(inf.size()-inf.used())); } bool enoughSpace=spaceAvailable>spaceRequired; @@ -277,15 +277,15 @@ void ActionDialog::copy(const QString &srcUdi, const QString &dstUdi, const QLis if (!enoughSpace) { MessageBox::information(this, i18n("There is insufficient space left on the destination device.\n" "The selected songs consume %1, but there is only %2 left.\n" - "The songs will need to be transcoded to a smaller filesize in order to be successfully copied.") - .arg(Utils::formatByteSize(spaceRequired)) - .arg(Utils::formatByteSize(spaceAvailable))); + "The songs will need to be transcoded to a smaller filesize in order to be successfully copied.", + Utils::formatByteSize(spaceRequired), + Utils::formatByteSize(spaceAvailable))); } } else { MessageBox::error(parentWidget(), i18n("There is insufficient space left on the destination.\n" - "The selected songs consume %1, but there is only %2 left.") - .arg(Utils::formatByteSize(spaceRequired)) - .arg(Utils::formatByteSize(spaceAvailable))); + "The selected songs consume %1, but there is only %2 left.", + Utils::formatByteSize(spaceRequired), + Utils::formatByteSize(spaceAvailable))); deleteLater(); } } @@ -616,56 +616,56 @@ void ActionDialog::actionStatus(int status, bool copiedCover) } break; case Device::FileExists: - setPage(PAGE_SKIP, i18n("The destination filename already exists!
%1").arg(formatSong(currentSong, true))); + setPage(PAGE_SKIP, i18n("The destination filename already exists!
%1", formatSong(currentSong, true))); break; case Device::SongExists: - setPage(PAGE_SKIP, i18n("Song already exists!
%1").arg(formatSong(currentSong))); + setPage(PAGE_SKIP, i18n("Song already exists!
%1", formatSong(currentSong))); break; case Device::SongDoesNotExist: - setPage(PAGE_SKIP, i18n("Song does not exist!
%1").arg(formatSong(currentSong))); + setPage(PAGE_SKIP, i18n("Song does not exist!
%1", formatSong(currentSong))); break; case Device::DirCreationFaild: - setPage(PAGE_SKIP, i18n("Failed to create destination folder!
Please check you have sufficient permissions.
%1").arg(formatSong(currentSong, true))); + setPage(PAGE_SKIP, i18n("Failed to create destination folder!
Please check you have sufficient permissions.
%1", formatSong(currentSong, true))); break; case Device::SourceFileDoesNotExist: - setPage(PAGE_SKIP, i18n("Source file no longer exists?

%1").arg(formatSong(currentSong, true))); + setPage(PAGE_SKIP, i18n("Source file no longer exists?

%1", formatSong(currentSong, true))); break; case Device::Failed: - setPage(PAGE_SKIP, Copy==mode ? i18n("Failed to copy.
%1").arg(formatSong(currentSong)) - : i18n("Failed to delete.
%1").arg(formatSong(currentSong))); + setPage(PAGE_SKIP, Copy==mode ? i18n("Failed to copy.
%1", formatSong(currentSong)) + : i18n("Failed to delete.
%1", formatSong(currentSong))); break; case Device::NotConnected: - setPage(PAGE_ERROR, i18n("Not connected to device.
%1").arg(formatSong(currentSong))); + setPage(PAGE_ERROR, i18n("Not connected to device.
%1", formatSong(currentSong))); break; case Device::CodecNotAvailable: - setPage(PAGE_ERROR, i18n("Selected codec is not available.
%1").arg(formatSong(currentSong))); + setPage(PAGE_ERROR, i18n("Selected codec is not available.
%1", formatSong(currentSong))); break; case Device::TranscodeFailed: - setPage(PAGE_SKIP, i18n("Transcoding failed.

%1").arg(formatSong(currentSong))); + setPage(PAGE_SKIP, i18n("Transcoding failed.

%1", formatSong(currentSong))); break; case Device::FailedToCreateTempFile: - setPage(PAGE_ERROR, i18n("Failed to create temporary file.
(Required for transcoding to MTP devices.)
%1").arg(formatSong(currentSong))); + setPage(PAGE_ERROR, i18n("Failed to create temporary file.
(Required for transcoding to MTP devices.)
%1", formatSong(currentSong))); break; case Device::ReadFailed: - setPage(PAGE_SKIP, i18n("Failed to read source file.

%1").arg(formatSong(currentSong))); + setPage(PAGE_SKIP, i18n("Failed to read source file.

%1", formatSong(currentSong))); break; case Device::WriteFailed: - setPage(PAGE_SKIP, i18n("Failed to write to destination file.

%1").arg(formatSong(currentSong))); + setPage(PAGE_SKIP, i18n("Failed to write to destination file.

%1", formatSong(currentSong))); break; case Device::NoSpace: - setPage(PAGE_SKIP, i18n("No space left on device.

%1").arg(formatSong(currentSong))); + setPage(PAGE_SKIP, i18n("No space left on device.

%1", formatSong(currentSong))); break; case Device::FailedToUpdateTags: - setPage(PAGE_SKIP, i18n("Failed to update metadata.

%1").arg(formatSong(currentSong))); + setPage(PAGE_SKIP, i18n("Failed to update metadata.

%1", formatSong(currentSong))); break; case Device::TooManyRedirects: - setPage(PAGE_SKIP, i18n("Failed to download track - too many redirects encountered.

%1").arg(formatSong(currentSong))); + setPage(PAGE_SKIP, i18n("Failed to download track - too many redirects encountered.

%1", formatSong(currentSong))); break; case Device::DownloadFailed: - setPage(PAGE_SKIP, i18n("Failed to download track.

%1").arg(formatSong(currentSong))); + setPage(PAGE_SKIP, i18n("Failed to download track.

%1", formatSong(currentSong))); break; case Device::FailedToLockDevice: - setPage(PAGE_ERROR, i18n("Failed to lock device.
%1").arg(formatSong(currentSong))); + setPage(PAGE_ERROR, i18n("Failed to lock device.
%1", formatSong(currentSong))); break; case Device::Cancelled: break; @@ -762,21 +762,17 @@ QString ActionDialog::formatSong(const Song &s, bool showFiles, bool showTime) QString str(""); str+=i18n("" "" - "") - .arg(s.albumArtist()) - .arg(s.album) - .arg(s.trackAndTitleStr(Song::isVariousArtists(s.albumArtist()) && !Song::isVariousArtists(s.artist))); + "", + s.albumArtist(), s.album, s.trackAndTitleStr(Song::isVariousArtists(s.albumArtist()) && !Song::isVariousArtists(s.artist))); if (showFiles) { if (Copy==mode) { str+=i18n("" - "") - .arg(DevicesModel::fixDevicePath(s.file)) - .arg(DevicesModel::fixDevicePath(destFile)); + "", + DevicesModel::fixDevicePath(s.file), DevicesModel::fixDevicePath(destFile)); } else { - str+=i18n("") - .arg(DevicesModel::fixDevicePath(s.file)); + str+=i18n("", DevicesModel::fixDevicePath(s.file)); } } @@ -791,12 +787,11 @@ QString ActionDialog::formatSong(const Song &s, bool showFiles, bool showTime) double pco=percent; percent-=percent*((1.0-percent)*0.15); quint64 timeRemaining=((taken/percent)-taken)/1000.0; - estimate=i18nc("time (Estimated)", "%1 (Estimated)").arg(Song::formattedTime(timeRemaining>0 ? timeRemaining : 0)); + estimate=i18nc("time (Estimated)", "%1 (Estimated)", Song::formattedTime(timeRemaining>0 ? timeRemaining : 0)); } } - str+=i18n("") - .arg(estimate); + str+=i18n("", estimate); } #else Q_UNUSED(showTime) diff --git a/devices/cddbinterface.cpp b/devices/cddbinterface.cpp index d3f4d035b..436db3cf0 100644 --- a/devices/cddbinterface.cpp +++ b/devices/cddbinterface.cpp @@ -297,7 +297,7 @@ void CddbInterface::lookup(bool full) QList m; for (;;) { if (!cddb.read()) { - emit error(i18n("CDDB error: %1").arg(cddb.error())); + emit error(i18n("CDDB error: %1", cddb.error())); return; } int numTracks=cddb.trackCount(); diff --git a/devices/cddbselectiondialog.cpp b/devices/cddbselectiondialog.cpp index 875597807..06933467f 100644 --- a/devices/cddbselectiondialog.cpp +++ b/devices/cddbselectiondialog.cpp @@ -64,9 +64,9 @@ int CddbSelectionDialog::select(const QList &albums) albumDetails=albums; foreach (const CdAlbum &a, albums) { if (a.disc>0) { - combo->addItem(QString("%1 -%2 %3 (%4)").arg(a.artist).arg(a.name).arg(i18n("Disc %1").arg(a.disc)).arg(a.year)); + combo->addItem(i18nc("artist - album Disc disc (year)", "%1 -%2 Disc %3 (%4)", a.artist, a.name, a.disc, a.year)); } else { - combo->addItem(QString("%1 - %2 (%3)").arg(a.artist).arg(a.name).arg(a.year)); + combo->addItem(i18nc("artist - album (year)", "%1 - %2 (%3)", a.artist, a.name, a.year)); } } diff --git a/devices/device.cpp b/devices/device.cpp index 9fdecc632..8c54530ed 100644 --- a/devices/device.cpp +++ b/devices/device.cpp @@ -337,7 +337,7 @@ void Device::updateStatus() void Device::songCount(int c) { - setStatusMessage(i18n("Updating (%1)...").arg(c)); + setStatusMessage(i18n("Updating (%1)...", c)); } #endif // Q_OS_WIN diff --git a/devices/devicepropertieswidget.cpp b/devices/devicepropertieswidget.cpp index 18ee4c527..71e1f6b85 100644 --- a/devices/devicepropertieswidget.cpp +++ b/devices/devicepropertieswidget.cpp @@ -225,7 +225,7 @@ void DevicePropertiesWidget::update(const QString &path, const DeviceOptions &op if (transcode && name.endsWith(QLatin1String(" (ffmpeg)"))) { name=name.left(name.length()-9); } - transcoderName->addItem(transcode ? i18n("Transcode to %1").arg(name) : name, e.codec); + transcoderName->addItem(transcode ? i18n("Transcode to %1", name) : name, e.codec); } } @@ -256,8 +256,8 @@ void DevicePropertiesWidget::update(const QString &path, const DeviceOptions &op REMOVE(defaultVolumeLabel); } else { foreach (const DeviceStorage &ds, storage) { - defaultVolume->addItem(i18nc("name (size free)", "%1 (%2 free)") - .arg(ds.description).arg(Utils::formatByteSize(ds.size-ds.used)), ds.volumeIdentifier); + defaultVolume->addItem(i18nc("name (size free)", "%1 (%2 free)", + ds.description, Utils::formatByteSize(ds.size-ds.used)), ds.volumeIdentifier); } for (int i=0; icount(); ++i) { diff --git a/devices/devicespage.cpp b/devices/devicespage.cpp index a885abf78..1d4e70410 100644 --- a/devices/devicespage.cpp +++ b/devices/devicespage.cpp @@ -513,7 +513,7 @@ void DevicesPage::forgetRemoteDevice() } QString udi=dev->udi(); QString devName=dev->data(); - if (MessageBox::Yes==MessageBox::warningYesNo(this, i18n("Are you sure you wish to forget %1?").arg(devName))) { + if (MessageBox::Yes==MessageBox::warningYesNo(this, i18n("Are you sure you wish to forget %1?", devName))) { DevicesModel::self()->removeRemoteDevice(udi); } #endif @@ -532,9 +532,9 @@ void DevicesPage::toggleDevice() Device *dev=static_cast(item); if (dev->isConnected() && (Device::AudioCd==dev->devType() - ? MessageBox::No==MessageBox::warningYesNo(this, i18n("Are you sure you wish to eject Audio CD %1 - %2?").arg(dev->data()).arg(dev->subText()), + ? MessageBox::No==MessageBox::warningYesNo(this, i18n("Are you sure you wish to eject Audio CD %1 - %2?", dev->data(), dev->subText()), i18n("Eject"), GuiItem(i18n("Eject")), StdGuiItem::cancel()) - : MessageBox::No==MessageBox::warningYesNo(this, i18n("Are you sure you wish to disconnect %1?").arg(dev->data()), + : MessageBox::No==MessageBox::warningYesNo(this, i18n("Are you sure you wish to disconnect %1?", dev->data()), i18n("Disconnect"), GuiItem(i18n("Disconnect")), StdGuiItem::cancel()))) { return; } diff --git a/devices/encoders.cpp b/devices/encoders.cpp index 6dcf02852..ae5f01c9d 100644 --- a/devices/encoders.cpp +++ b/devices/encoders.cpp @@ -99,17 +99,17 @@ static void init() QLatin1String("libfaac"), QLatin1String("-aq"), i18n("Expected average bitrate for variable bitrate encoding"), - QList() << Setting(i18n(vbr).arg(25), 30) - << Setting(i18n(vbr).arg(50), 55) - << Setting(i18n(vbr).arg(70), 80) - << Setting(i18n(vbr).arg(90), 105) - << Setting(i18n(vbr).arg(120), 125) - << Setting(i18n(vbr).arg(150), 155) - << Setting(i18n(vbr).arg(170), 180) - << Setting(i18n(vbr).arg(180), 205) - << Setting(i18n(vbr).arg(190), 230) - << Setting(i18n(vbr).arg(200), 255) - << Setting(i18n(vbr).arg(210), 280), + QList() << Setting(i18n(vbr, 25), 30) + << Setting(i18n(vbr, 50), 55) + << Setting(i18n(vbr, 70), 80) + << Setting(i18n(vbr, 90), 105) + << Setting(i18n(vbr, 120), 125) + << Setting(i18n(vbr, 150), 155) + << Setting(i18n(vbr, 170), 180) + << Setting(i18n(vbr, 180), 205) + << Setting(i18n(vbr, 190), 230) + << Setting(i18n(vbr, 200), 255) + << Setting(i18n(vbr, 210), 280), i18n("Smaller file"), i18n("Better sound quality"), 5); @@ -139,16 +139,16 @@ static void init() QLatin1String("libmp3lame"), QLatin1String("-aq"), i18n("Expected average bitrate for variable bitrate encoding"), - QList() << Setting(i18n(vbr).arg(80), 9) - << Setting(i18n(vbr).arg(100), 8) - << Setting(i18n(vbr).arg(120), 7) - << Setting(i18n(vbr).arg(140), 6) - << Setting(i18n(vbr).arg(160), 5) - << Setting(i18n(vbr).arg(175), 4) - << Setting(i18n(vbr).arg(190), 3) - << Setting(i18n(vbr).arg(205), 2) - << Setting(i18n(vbr).arg(220), 1) - << Setting(i18n(vbr).arg(240), 0), + QList() << Setting(i18n(vbr, 80), 9) + << Setting(i18n(vbr, 100), 8) + << Setting(i18n(vbr, 120), 7) + << Setting(i18n(vbr, 140), 6) + << Setting(i18n(vbr, 160), 5) + << Setting(i18n(vbr, 175), 4) + << Setting(i18n(vbr, 190), 3) + << Setting(i18n(vbr, 205), 2) + << Setting(i18n(vbr, 220), 1) + << Setting(i18n(vbr, 240), 0), i18n("Smaller file"), i18n("Better sound quality"), 4); @@ -182,18 +182,18 @@ static void init() QLatin1String("libvorbis"), QLatin1String("-aq"), i18n("Quality rating"), - QList() << Setting(i18n(quality).arg(-1).arg(45), -1) - << Setting(i18n(quality).arg(0).arg(64), 0) - << Setting(i18n(quality).arg(1).arg(80), 1) - << Setting(i18n(quality).arg(2).arg(96), 2) - << Setting(i18n(quality).arg(3).arg(112), 3) - << Setting(i18n(quality).arg(4).arg(128), 4) - << Setting(i18n(quality).arg(5).arg(160), 5) - << Setting(i18n(quality).arg(6).arg(192), 6) - << Setting(i18n(quality).arg(7).arg(224), 7) - << Setting(i18n(quality).arg(8).arg(256), 8) - << Setting(i18n(quality).arg(9).arg(320), 9) - << Setting(i18n(quality).arg(10).arg(500), 10), + QList() << Setting(i18n(quality, -1, 45), -1) + << Setting(i18n(quality, 0, 64), 0) + << Setting(i18n(quality, 1, 80), 1) + << Setting(i18n(quality, 2, 96), 2) + << Setting(i18n(quality, 3, 112), 3) + << Setting(i18n(quality, 4, 128), 4) + << Setting(i18n(quality, 5, 160), 5) + << Setting(i18n(quality, 6, 192), 6) + << Setting(i18n(quality, 7, 224), 7) + << Setting(i18n(quality, 8, 256), 8) + << Setting(i18n(quality, 9, 320), 9) + << Setting(i18n(quality, 10, 500), 10), i18n("Smaller file"), i18n("Better sound quality"), 6); @@ -280,14 +280,14 @@ static void init() QLatin1String("wmav2"), QLatin1String("-ab"), i18n("Bitrate"), - QList() << Setting(i18n(cbr).arg(64), 65*1000) - << Setting(i18n(cbr).arg(80), 75*1000) - << Setting(i18n(cbr).arg(96), 88*1000) - << Setting(i18n(cbr).arg(112), 106*1000) - << Setting(i18n(cbr).arg(136), 133*1000) - << Setting(i18n(cbr).arg(182), 180*1000) - << Setting(i18n(cbr).arg(275), 271*1000) - << Setting(i18n(cbr).arg(550), 545*1000), + QList() << Setting(i18n(cbr, 64), 65*1000) + << Setting(i18n(cbr, 80), 75*1000) + << Setting(i18n(cbr, 96), 88*1000) + << Setting(i18n(cbr, 112), 106*1000) + << Setting(i18n(cbr, 136), 133*1000) + << Setting(i18n(cbr, 182), 180*1000) + << Setting(i18n(cbr, 275), 271*1000) + << Setting(i18n(cbr, 550), 545*1000), i18n("Smaller file"), i18n("Better sound quality"), 4)); diff --git a/devices/filenameschemedialog.cpp b/devices/filenameschemedialog.cpp index eeffe494b..a2bff6b99 100644 --- a/devices/filenameschemedialog.cpp +++ b/devices/filenameschemedialog.cpp @@ -99,26 +99,20 @@ void FilenameSchemeDialog::showHelp() i18n("

The following variables will be replaced with their corresponding meaning for each track name.

" "

Artist:%1
Album:%2
Track:%3
Track:%3
Source file:%1
Destination file:%2
Destination file:%2
File:%1
File:%1
Time remaining:%5
Time remaining:%5
" "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "
ButtonVariableDescription
%1%2The artist of the album. For most albums, this will be the same as the Track Artist. " + "
%albumartist%%1The artist of the album. For most albums, this will be the same as the Track Artist. " "For compilations, this will often be Various Artists.
%3%4The name of the album.
%5%6The artist of each track.
%7%8The track title (without Track Artist).
%9%10The track title (with Track Artist, if different to Album Artist).
%11%12The track number.
%13%14The album number of a multi-album album. Often compilations consist of several albums.
%15%16The year of the album's release.
%17%18The genre of the album.

") - .arg(stripAccelerator(albumArtist->text())).arg(DeviceOptions::constAlbumArtist) - .arg(stripAccelerator(albumTitle->text())).arg(DeviceOptions::constAlbumTitle) - .arg(stripAccelerator(trackArtist->text())).arg(DeviceOptions::constTrackArtist) - .arg(stripAccelerator(trackTitle->text())).arg(DeviceOptions::constTrackTitle) - .arg(stripAccelerator(trackArtistAndTitle->text())).arg(DeviceOptions::constTrackArtistAndTitle) - .arg(stripAccelerator(trackNo->text())).arg(DeviceOptions::constTrackNumber) - .arg(stripAccelerator(cdNo->text())).arg(DeviceOptions::constCdNumber) - .arg(stripAccelerator(year->text())).arg(DeviceOptions::constYear) - .arg(stripAccelerator(genre->text())).arg(DeviceOptions::constGenre)); + "%album%%2The name of the album." + "%artist%%3The artist of each track." + "%title%%4The track title (without Track Artist)." + "%artistandtitle%%5The track title (with Track Artist, if different to Album Artist)." + "%track%%6The track number." + "%discnumber%%7The album number of a multi-album album. Often compilations consist of several albums." + "%year%%8The year of the album's release." + "%genre%%9The genre of the album." + "

", stripAccelerator(albumArtist->text()), stripAccelerator(albumTitle->text()), + stripAccelerator(trackArtist->text()), stripAccelerator(trackTitle->text()), + stripAccelerator(trackArtistAndTitle->text()), stripAccelerator(trackNo->text()), + stripAccelerator(cdNo->text()), stripAccelerator(year->text()), stripAccelerator(genre->text()))); } void FilenameSchemeDialog::enableOkButton() diff --git a/devices/fsdevice.cpp b/devices/fsdevice.cpp index 58179fa29..c2a4aa396 100644 --- a/devices/fsdevice.cpp +++ b/devices/fsdevice.cpp @@ -769,6 +769,6 @@ void FsDevice::cacheStatus(const QString &msg, int prog) { if (prog!=cacheProgress) { cacheProgress=prog; - setStatusMessage(i18nc("Message percent", "%1 %2%").arg(msg).arg(cacheProgress)); + setStatusMessage(i18nc("Message percent", "%1 %2%", msg, cacheProgress)); } } diff --git a/devices/mtpdevice.cpp b/devices/mtpdevice.cpp index 695367b66..cb2ac6d10 100644 --- a/devices/mtpdevice.cpp +++ b/devices/mtpdevice.cpp @@ -1473,7 +1473,7 @@ QString MtpDevice::capacityString() return i18n("Not Connected"); } - return i18n("%1 free").arg(Utils::formatByteSize(connection->capacity()-connection->usedSpace())); + return i18n("%1 free", Utils::formatByteSize(connection->capacity()-connection->usedSpace())); } qint64 MtpDevice::freeSpace() diff --git a/devices/musicbrainz.cpp b/devices/musicbrainz.cpp index d1610c60c..da7cd691b 100644 --- a/devices/musicbrainz.cpp +++ b/devices/musicbrainz.cpp @@ -317,7 +317,7 @@ void MusicBrainz::lookup(bool full) album.name=QString::fromUtf8(fullRelease->Title().c_str()); if (fullRelease->MediumList()->NumItems() > 1) { - album.name = i18n("%1 (Disc %2)").arg(album.name).arg(medium->Position()); + album.name = i18n("%1 (Disc %2)", album.name, medium->Position()); album.disc=medium->Position(); } album.artist=artistFromCreditList(fullRelease->ArtistCredit()); diff --git a/devices/remotedevicepropertiesdialog.cpp b/devices/remotedevicepropertiesdialog.cpp index 4593a6cd2..335021162 100644 --- a/devices/remotedevicepropertiesdialog.cpp +++ b/devices/remotedevicepropertiesdialog.cpp @@ -88,7 +88,7 @@ void RemoteDevicePropertiesDialog::slotButtonClicked(int button) case Ok: { RemoteFsDevice::Details d=remoteProp->details(); if (d.name!=remoteProp->origDetails().name && DevicesModel::self()->device(RemoteFsDevice::createUdi(d.name))) { - MessageBox::error(this, i18n("A remote device named \"%1\" already exists!\nPlease choose a different name").arg(d.name)); + MessageBox::error(this, i18n("A remote device named \"%1\" already exists!\nPlease choose a different name", d.name)); } else { emit updatedSettings(devProp->settings(), remoteProp->details()); accept(); diff --git a/devices/remotefsdevice.cpp b/devices/remotefsdevice.cpp index ed1bf06f8..c2994da2b 100644 --- a/devices/remotefsdevice.cpp +++ b/devices/remotefsdevice.cpp @@ -312,7 +312,7 @@ void RemoteFsDevice::mount() Details det=details; AvahiService *srv=Avahi::self()->getService(det.serviceName); if (!srv || srv->getHost().isEmpty() || 0==srv->getPort()) { - emit error(i18n("Failed to resolve connection details for %1").arg(details.name)); + emit error(i18n("Failed to resolve connection details for %1", details.name)); return; } if (constPromptPassword==det.url.password()) { @@ -383,7 +383,7 @@ void RemoteFsDevice::mount() cmd=Utils::findExe("sshfs"); if (!cmd.isEmpty()) { if (!QDir(mountPoint(details, true)).entryList(QDir::NoDot|QDir::NoDotDot|QDir::AllEntries|QDir::Hidden).isEmpty()) { - emit error(i18n("Mount point (\"%1\") is not empty!").arg(mountPoint(details, true))); + emit error(i18n("Mount point (\"%1\") is not empty!", mountPoint(details, true))); return; } @@ -458,8 +458,8 @@ void RemoteFsDevice::procFinished(int exitCode) proc=0; if (0!=exitCode) { - emit error(wasMount ? i18n("Failed to connect to \"%1\"").arg(details.name) - : i18n("Failed to disconnect from \"%1\"").arg(details.name)); + emit error(wasMount ? i18n("Failed to connect to \"%1\"", details.name) + : i18n("Failed to disconnect from \"%1\"", details.name)); setStatusMessage(QString()); } else if (wasMount) { setStatusMessage(i18n("Updating tracks...")); @@ -479,7 +479,7 @@ void RemoteFsDevice::mountStatus(const QString &mp, int pid, int st) if (pid==getpid() && mp==mountPoint(details, false)) { messageSent=false; if (0!=st) { - emit error(i18n("Failed to connect to \"%1\"").arg(details.name)); + emit error(i18n("Failed to connect to \"%1\"", details.name)); setStatusMessage(QString()); } else { setStatusMessage(i18n("Updating tracks...")); @@ -494,7 +494,7 @@ void RemoteFsDevice::umountStatus(const QString &mp, int pid, int st) if (pid==getpid() && mp==mountPoint(details, false)) { messageSent=false; if (0!=st) { - emit error(i18n("Failed to disconnect from \"%1\"").arg(details.name)); + emit error(i18n("Failed to disconnect from \"%1\"", details.name)); setStatusMessage(QString()); } else { setStatusMessage(QString()); @@ -572,7 +572,7 @@ QString RemoteFsDevice::capacityString() if (isOldSshfs()) { return i18n("Capacity Unknown"); } - return i18n("%1 free").arg(Utils::formatByteSize(spaceInfo.size()-spaceInfo.used())); + return i18n("%1 free", Utils::formatByteSize(spaceInfo.size()-spaceInfo.used())); } qint64 RemoteFsDevice::freeSpace() diff --git a/devices/synccollectionwidget.cpp b/devices/synccollectionwidget.cpp index 92b083f43..876edb034 100644 --- a/devices/synccollectionwidget.cpp +++ b/devices/synccollectionwidget.cpp @@ -265,7 +265,7 @@ void SyncCollectionWidget::updateStats() if (checkedSongs.isEmpty()) { selection->setText(i18n("Nothing selected")); } else { - selection->setText(i18n("Artists:%1, Albums:%2, Songs:%3").arg(artists.count()).arg(albums.count()).arg(checkedSongs.count())); + selection->setText(i18n("Artists:%1, Albums:%2, Songs:%3", artists.count(), albums.count(), checkedSongs.count())); } copyAction->setEnabled(!checkedSongs.isEmpty()); } diff --git a/devices/umsdevice.cpp b/devices/umsdevice.cpp index b18b4bd6b..073b3358d 100644 --- a/devices/umsdevice.cpp +++ b/devices/umsdevice.cpp @@ -102,7 +102,7 @@ QString UmsDevice::capacityString() return i18n("Not Connected"); } - return i18n("%1 free").arg(Utils::formatByteSize(spaceInfo.size()-spaceInfo.used())); + return i18n("%1 free", Utils::formatByteSize(spaceInfo.size()-spaceInfo.used())); } qint64 UmsDevice::freeSpace() diff --git a/dynamic/dynamic.cpp b/dynamic/dynamic.cpp index a85b0f9e2..1f8030860 100644 --- a/dynamic/dynamic.cpp +++ b/dynamic/dynamic.cpp @@ -386,7 +386,7 @@ void Dynamic::start(const QString &name) QString fName(Utils::configDir(constDir, false)+name+constExtension); if (!QFile::exists(fName)) { - emit error(i18n("Failed to locate rules file - %1").arg(fName)); + emit error(i18n("Failed to locate rules file - %1", fName)); return; } @@ -394,12 +394,12 @@ void Dynamic::start(const QString &name) QFile::remove(rules); if (QFile::exists(rules)) { - emit error(i18n("Failed to remove previous rules file - %1").arg(rules)); + emit error(i18n("Failed to remove previous rules file - %1", rules)); return; } if (!QFile::link(fName, rules)) { - emit error(i18n("Failed to install rules file - %1 -> %2").arg(fName).arg(rules)); + emit error(i18n("Failed to install rules file - %1 -> %2", fName, rules)); return; } @@ -796,7 +796,7 @@ void Dynamic::sendCommand(Command cmd, const QStringList &args) case Id: cmdStr=i18n("Requesting ID details"); break; default: break; } - emit error(i18n("Awaiting response for previous command. (%1)").arg(cmdStr)); + emit error(i18n("Awaiting response for previous command. (%1)", cmdStr)); } return; } @@ -959,7 +959,7 @@ void Dynamic::remoteJobFinished() if (cmdOk) { parseRemote(response); } else { - emit error(i18n("Failed to retrieve list of dynamic rules. (%1)").arg(response)); + emit error(i18n("Failed to retrieve list of dynamic rules. (%1)", response)); } emit loadedList(); break; @@ -990,14 +990,14 @@ void Dynamic::remoteJobFinished() } checkResponse(response); } else { - emit error(i18n("Failed to delete rules file. (%1)").arg(response)); + emit error(i18n("Failed to delete rules file. (%1)", response)); } break; case Control: if (cmdOk) { checkResponse(response); } else { - emit error(i18n("Failed to control dynamizer state. (%1)").arg(response)); + emit error(i18n("Failed to control dynamizer state. (%1)", response)); } lastState.clear(); break; @@ -1006,7 +1006,7 @@ void Dynamic::remoteJobFinished() checkResponse(response); QTimer::singleShot(1000, this, SLOT(updateRemoteStatus())); } else { - emit error(i18n("Failed to set the current dynamic rules. (%1)").arg(response)); + emit error(i18n("Failed to set the current dynamic rules. (%1)", response)); } lastState.clear(); break; diff --git a/dynamic/dynamicruledialog.cpp b/dynamic/dynamicruledialog.cpp index 3e7e1d214..26936d75b 100644 --- a/dynamic/dynamicruledialog.cpp +++ b/dynamic/dynamicruledialog.cpp @@ -191,7 +191,7 @@ void DynamicRuleDialog::enableOkButton() errorLabel->setText(i18n("ERROR: 'From Year' should be less than 'To Year'")); errorLabel->setVisible(true); } else if (dateTo-dateFrom>constMaxDateRange) { - errorLabel->setText(i18n("ERROR: Date range is too large (can only be a maximum of %1 years)").arg(constMaxDateRange)); + errorLabel->setText(i18n("ERROR: Date range is too large (can only be a maximum of %1 years)", constMaxDateRange)); errorLabel->setVisible(true); } } diff --git a/dynamic/dynamicrulesdialog.cpp b/dynamic/dynamicrulesdialog.cpp index 7cfe28f25..6e71a8e12 100644 --- a/dynamic/dynamicrulesdialog.cpp +++ b/dynamic/dynamicrulesdialog.cpp @@ -304,7 +304,7 @@ void DynamicRulesDialog::saved(bool s) if (s) { accept(); } else { - messageWidget->setError(i18n("Failed to save %1").arg(nameText->text().trimmed())); + messageWidget->setError(i18n("Failed to save %1", nameText->text().trimmed())); controls->setEnabled(true); } } @@ -322,7 +322,7 @@ bool DynamicRulesDialog::save() } if (name!=origName && Dynamic::self()->exists(name) && - MessageBox::No==MessageBox::warningYesNo(this, i18n("A set of rules named \'%1\' already exists!\nOverwrite?").arg(name), + MessageBox::No==MessageBox::warningYesNo(this, i18n("A set of rules named \'%1\' already exists!\nOverwrite?", name), i18n("Overwrite Rules"), StdGuiItem::overwrite(), StdGuiItem::cancel())) { return false; } @@ -348,7 +348,7 @@ bool DynamicRulesDialog::save() if (Dynamic::self()->isRemote()) { if (saved) { - messageWidget->setInformation(i18n("Saving %1").arg(name)); + messageWidget->setInformation(i18n("Saving %1", name)); controls->setEnabled(false); enableButton(Ok, false); } diff --git a/gui/cachesettings.cpp b/gui/cachesettings.cpp index 7e0f42d21..1e384fe08 100644 --- a/gui/cachesettings.cpp +++ b/gui/cachesettings.cpp @@ -285,7 +285,7 @@ void CacheSettings::deleteAll() if (!toDelete.isEmpty()) { if (1==toDelete.count()) { - if (MessageBox::Yes==MessageBox::warningYesNo(this, i18n("Delete all '%1' items?").arg(toDelete.at(0)->name()), + if (MessageBox::Yes==MessageBox::warningYesNo(this, i18n("Delete all '%1' items?", toDelete.at(0)->name()), i18n("Delete Cache Items"), StdGuiItem::del(), StdGuiItem::cancel())) { toDelete.first()->clean(); } @@ -295,7 +295,7 @@ void CacheSettings::deleteAll() items+="
  • "+i->name()+"
  • "; } - if (MessageBox::No==MessageBox::warningYesNo(this, i18n("

    Delete all from the following?

    ").arg(items), + if (MessageBox::No==MessageBox::warningYesNo(this, i18n("

    Delete all from the following?

    ", items), i18n("Delete Cache Items"), StdGuiItem::del(), StdGuiItem::cancel())) { return; } diff --git a/gui/coverdialog.cpp b/gui/coverdialog.cpp index 783f0ebf3..f96f1f910 100644 --- a/gui/coverdialog.cpp +++ b/gui/coverdialog.cpp @@ -161,8 +161,8 @@ public: : CoverItem(u, QString(), parent) , img(i) { setImage(i); - setText(i18nc("name\nwidth x height (file size)", "%1\n%2 x %3 (%4)") - .arg(Utils::getFile(u)).arg(img.width()).arg(img.height()).arg(Utils::formatByteSize(QFileInfo(u).size()))); + setText(i18nc("name\nwidth x height (file size)", "%1\n%2 x %3 (%4)", + Utils::getFile(u), img.width(), img.height(), Utils::formatByteSize(QFileInfo(u).size()))); } quint32 key() const { return 0xFFFFFFFE; } @@ -180,7 +180,7 @@ public: , width(w) , height(h) { setImage(img); - setText(i18nc("Google\nwidth x height (file size)", "Google\n%1 x %2 (%3)").arg(width).arg(height).arg(Utils::formatByteSize(size*1024))); + setText(i18nc("Google\nwidth x height (file size)", "Google\n%1 x %2 (%3)", width, height, Utils::formatByteSize(size*1024))); } quint32 key() const { return width*height; } @@ -200,7 +200,7 @@ public: , height(h) { setImage(img); setText(width>10 && height>10 - ? i18nc("Discogs\nwidth x height", "Discogs\n%1 x %2").arg(width).arg(height) + ? i18nc("Discogs\nwidth x height", "Discogs\n%1 x %2", width, height) : QLatin1String("Discogs")); } @@ -234,7 +234,7 @@ public: QFont f(font()); f.setBold((true)); setFont(f); - setText(i18nc("Current Cover\nwidth x height", "Current Cover\n%1 x %2").arg(img.img.width()).arg(img.img.height())); + setText(i18nc("Current Cover\nwidth x height", "Current Cover\n%1 x %2", img.img.width(), img.img.height())); } quint32 key() const { return 0xFFFFFFFF; } @@ -300,7 +300,7 @@ void CoverPreview::showImage(const QImage &img, const QString &u) imgW=img.width(); imgH=img.height(); resize(lrPad+qMax(100, qMin(maxWidth, imgW+fw)), tbPad+qMax(100, qMin(maxHeight, imgH+fw))); - setWindowTitle(i18nc("Image (width x height zoom%)", "Image (%1 x %2 %3%)").arg(imgW).arg(imgH).arg(zoom*100)); + setWindowTitle(i18nc("Image (width x height zoom%)", "Image (%1 x %2 %3%)", imgW, imgH, zoom*100)); show(); } } @@ -335,7 +335,7 @@ void CoverPreview::scaleImage(int adjust) } zoom=newZoom; imageLabel->resize(zoom * imageLabel->pixmap()->size()); - setWindowTitle(i18nc("Image (width x height zoom%)", "Image (%1 x %2 %3%)").arg(imgW).arg(imgH).arg(zoom*100)); + setWindowTitle(i18nc("Image (width x height zoom%)", "Image (%1 x %2 %3%)", imgW, imgH, zoom*100)); } void CoverPreview::wheelEvent(QWheelEvent *event) @@ -428,15 +428,15 @@ void CoverDialog::show(const Song &s, const Covers::Image ¤t) if (!img.fileName.isEmpty() && !QFileInfo(img.fileName).isWritable()) { MessageBox::error(parentWidget(), isArtist - ? i18n("

    An image already exists for this artist, and the file is not writeable.

    %1

    ").arg(img.fileName) - : i18n("

    A cover already exists for this album, and the file is not writeable.

    %1

    ").arg(img.fileName)); + ? i18n("

    An image already exists for this artist, and the file is not writeable.

    %1

    ", img.fileName) + : i18n("

    A cover already exists for this album, and the file is not writeable.

    %1

    ", img.fileName)); deleteLater(); return; } if (isArtist) { setCaption(song.albumartist); } else { - setCaption(i18nc("Album by Artist", "%1 by %2").arg(song.album).arg(song.albumArtist())); + setCaption(i18nc("Album by Artist", "%1 by %2", song.album, song.albumArtist())); } if (!img.img.isNull()) { existing=new ExistingCover(isArtist ? Covers::Image(cropImage(img.img, true), img.fileName) : img, list); @@ -1273,7 +1273,7 @@ bool CoverDialog::saveCover(const QString &src, const QImage &img) if (existing && !existingBackup.isEmpty()) { QFile::rename(existingBackup, existing->url()); } - MessageBox::error(this, i18n("Failed to set cover!\nCould not copy file to '%1'!").arg(destName)); + MessageBox::error(this, i18n("Failed to set cover!\nCould not copy file to '%1'!", destName)); return false; } } diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 11d944f99..e0168d7c3 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1097,7 +1097,7 @@ void MainWindow::connectToMpd(const MPDConnectionDetails &details) if (!MPDConnection::self()->getDetails().isEmpty() && details!=MPDConnection::self()->getDetails()) { Dynamic::self()->stop(); } - showInformation(i18n("Connecting to %1").arg(details.description())); + showInformation(i18n("Connecting to %1", details.description())); outputsAction->setVisible(false); if (CS_Init!=connectedState) { connectedState=CS_Disconnected; @@ -1459,7 +1459,7 @@ void MainWindow::showAboutDialog() { QMessageBox::about(this, i18nc("Qt-only", "About Cantata"), i18nc("Qt-only", "Cantata %1

    MPD client.

    " - "(c) Craig Drummond 2011-2013.
    Released under the GPLv3").arg(PACKAGE_VERSION_STRING)+ + "(c) Craig Drummond 2011-2013.
    Released under the GPLv3", PACKAGE_VERSION_STRING)+ QLatin1String("

    ")+i18n("Based upon QtMPC - (C) 2007-2010 The QtMPC Authors
    ")+ // (ContextWidget::constHtbApiKey.latin1() ? i18nc("Qt-only", "Context view backdrops courtesy of Home Theater Backdrops
    ") : "")+ i18nc("Qt-only", "Context view backdrops courtesy of FanArt.tv")+QLatin1String("
    ")+ @@ -1474,28 +1474,24 @@ void MainWindow::showServerInfo() QStringList handlers=MPDConnection::self()->urlHandlers().toList(); qSort(handlers); long version=MPDConnection::self()->version(); - MessageBox::information(this, i18n("

    " - "" + MessageBox::information(this, QLatin1String("

    Server
    ")+ + i18n("" "" "" - "" - "" - "" - "" - "" - "" - "" - "" - "
    Server
    Version:%1.%2.%3
    Uptime:%4
    Time playing:%5
    Database
    Artists:%6
    Albums:%7
    Songs:%8
    URL handlers:%9
    Total duration:%10
    Last update:%11

    ") - .arg((version>>16)&0xFF).arg((version>>8)&0xFF).arg(version&0xFF) - .arg(MPDParseUtils::formatDuration(MPDStats::self()->uptime())) - .arg(MPDParseUtils::formatDuration(MPDStats::self()->playtime())) - .arg(MPDStats::self()->artists()) - .arg(MPDStats::self()->albums()) - .arg(MPDStats::self()->songs()) - .arg(handlers.join(", ")) - .arg(MPDParseUtils::formatDuration(MPDStats::self()->dbPlaytime())) - .arg(MPDStats::self()->dbUpdate().toString(Qt::SystemLocaleShortDate)), + "Time playing:%5", + (version>>16)&0xFF, (version>>8)&0xFF, version&0xFF, + MPDParseUtils::formatDuration(MPDStats::self()->uptime()), + MPDParseUtils::formatDuration(MPDStats::self()->playtime()))+ + QLatin1String("")+ + i18n("Database" + "Artists:%1" + "Albums:%2" + "Songs:%3" + "URL handlers:%4" + "Total duration:%5" + "Last update:%6

    ", + MPDStats::self()->artists(), MPDStats::self()->albums(), MPDStats::self()->songs(), handlers.join(", "), + MPDParseUtils::formatDuration(MPDStats::self()->dbPlaytime()), MPDStats::self()->dbUpdate().toString(Qt::SystemLocaleShortDate)), i18n("Server Information")); } @@ -1743,24 +1739,24 @@ void MainWindow::updateWindowTitle() QString connection=MPDConnection::self()->getDetails().getName(); if (stopped) { - setWindowTitle(multipleConnections ? i18n("Cantata (%1)").arg(connection) : "Cantata"); + setWindowTitle(multipleConnections ? i18n("Cantata (%1)", connection) : "Cantata"); } else if (current.isStream() && !current.isCantataStream() && !current.isCdda()) { setWindowTitle(multipleConnections - ? i18nc("track :: Cantata (connection)", "%1 :: Cantata (%2)").arg(trackLabel->text()).arg(connection) - : i18nc("track :: Cantata", "%1 :: Cantata").arg(trackLabel->text())); + ? i18nc("track :: Cantata (connection)", "%1 :: Cantata (%2)", trackLabel->text(), connection) + : i18nc("track :: Cantata", "%1 :: Cantata", trackLabel->text())); } else if (current.artist.isEmpty()) { if (trackLabel->text().isEmpty()) { - setWindowTitle(multipleConnections ? i18n("Cantata (%1)").arg(connection) : "Cantata"); + setWindowTitle(multipleConnections ? i18n("Cantata (%1)", connection) : "Cantata"); } else { setWindowTitle(multipleConnections - ? i18nc("track :: Cantata (connection)", "%1 :: Cantata (%2)").arg(trackLabel->text()).arg(connection) - : i18nc("track :: Cantata", "%1 :: Cantata").arg(trackLabel->text())); + ? i18nc("track :: Cantata (connection)", "%1 :: Cantata (%2)", trackLabel->text(), connection) + : i18nc("track :: Cantata", "%1 :: Cantata", trackLabel->text())); } } else { setWindowTitle(multipleConnections - ? i18nc("track - artist :: Cantata (connection)", "%1 - %2 :: Cantata (%3)") - .arg(trackLabel->text()).arg(current.artist).arg(connection) - : i18nc("track - artist :: Cantata", "%1 - %2 :: Cantata").arg(trackLabel->text()).arg(current.artist)); + ? i18nc("track - artist :: Cantata (connection)", "%1 - %2 :: Cantata (%3)", + trackLabel->text(), current.artist, connection) + : i18nc("track - artist :: Cantata", "%1 - %2 :: Cantata", trackLabel->text(), current.artist)); } } @@ -1807,7 +1803,7 @@ void MainWindow::updateCurrentSong(const Song &song) if (current.artist.isEmpty() && current.title.isEmpty() && !current.name.isEmpty()) { artistLabel->setText(i18n("(Stream)")); } else { - artistLabel->setText(current.artist.isEmpty() ? current.title : i18nc("title - artist", "%1 - %2").arg(current.artist).arg(current.title)); + artistLabel->setText(current.artist.isEmpty() ? current.title : i18nc("title - artist", "%1 - %2", current.artist, current.title)); } } else { if (current.title.isEmpty() && current.artist.isEmpty() && (!current.name.isEmpty() || !current.file.isEmpty())) { @@ -1825,7 +1821,7 @@ void MainWindow::updateCurrentSong(const Song &song) if (year>0) { album+=QString(" (%1)").arg(year); } - artistLabel->setText(i18nc("artist - album", "%1 - %2").arg(current.artist).arg(album)); + artistLabel->setText(i18nc("artist - album", "%1 - %2", current.artist, album)); } } @@ -1933,7 +1929,7 @@ void MainWindow::updateStatus(MPDStatus * const status) } } volumeButton->setEnabled(true); - volumeButton->setToolTip(unmuteVolume>0 ? i18n("Volume %1% (Muted)").arg(volume) : i18n("Volume %1%").arg(volume)); + volumeButton->setToolTip(unmuteVolume>0 ? i18n("Volume %1% (Muted)", volume) : i18n("Volume %1%", volume)); volumeControl->setToolTip(volumeButton->toolTip()); volumeControl->setValue(volume); } @@ -2145,7 +2141,7 @@ void MainWindow::addToNewStoredPlaylist() QString name = InputDialog::getText(i18n("Playlist Name"), i18n("Enter a name for the playlist:"), QString(), 0, this); if (PlaylistsModel::self()->exists(name)) { - switch(MessageBox::warningYesNoCancel(this, i18n("A playlist named %1 already exists!
    Add to that playlist?").arg(name), + switch(MessageBox::warningYesNoCancel(this, i18n("A playlist named %1 already exists!
    Add to that playlist?", name), i18n("Existing Playlist"))) { case MessageBox::Cancel: return; diff --git a/gui/playbacksettings.cpp b/gui/playbacksettings.cpp index 44350987e..f79341f99 100644 --- a/gui/playbacksettings.cpp +++ b/gui/playbacksettings.cpp @@ -140,8 +140,8 @@ void PlaybackSettings::mpdConnectionStateChanged(bool c) #endif messageIcon->setPixmap(Icon(c ? "dialog-information" : "dialog-warning").pixmap(messageIcon->minimumSize())); if (c) { - messageLabel->setText(i18n("Connected to %1
    The entries below apply to the currently connected MPD collection.
    ") - .arg(MPDConnection::self()->getDetails().description())); + messageLabel->setText(i18n("Connected to %1
    The entries below apply to the currently connected MPD collection.
    ", + MPDConnection::self()->getDetails().description())); } else { messageLabel->setText(i18n("Not Connected!
    The entries below cannot be modified, as Cantata is not connected to MPD.
    ")); outputsView->clear(); diff --git a/gui/playlistspage.cpp b/gui/playlistspage.cpp index e3f7c6593..8a97130f1 100644 --- a/gui/playlistspage.cpp +++ b/gui/playlistspage.cpp @@ -204,7 +204,7 @@ void PlaylistsPage::savePlaylist() if (!name.isEmpty()) { if (PlaylistsModel::self()->exists(name)) { - if (MessageBox::No==MessageBox::warningYesNo(this, i18n("A playlist named %1 already exists!
    Overwrite?").arg(name), + if (MessageBox::No==MessageBox::warningYesNo(this, i18n("A playlist named %1 already exists!
    Overwrite?", name), i18n("Overwrite Playlist"), StdGuiItem::overwrite(), StdGuiItem::cancel())) { return; } @@ -227,7 +227,7 @@ void PlaylistsPage::renamePlaylist() if (!newName.isEmpty() && name!=newName) { if (PlaylistsModel::self()->exists(newName)) { - if (MessageBox::No==MessageBox::warningYesNo(this, i18n("A playlist named %1 already exists!
    Overwrite?").arg(newName), + if (MessageBox::No==MessageBox::warningYesNo(this, i18n("A playlist named %1 already exists!
    Overwrite?", newName), i18n("Overwrite Playlist"), StdGuiItem::overwrite(), StdGuiItem::cancel())) { return; } diff --git a/gui/serversettings.cpp b/gui/serversettings.cpp index 53885955d..bb8edf881 100644 --- a/gui/serversettings.cpp +++ b/gui/serversettings.cpp @@ -261,7 +261,7 @@ void ServerSettings::remove() { int index=combo->currentIndex(); QString cName=1==stackedWidget->currentIndex() ? MPDUser::translatedName() : name->text(); - if (combo->count()>1 && MessageBox::Yes==MessageBox::questionYesNo(this, i18n("Delete %1?").arg(cName), + if (combo->count()>1 && MessageBox::Yes==MessageBox::questionYesNo(this, i18n("Delete %1?", cName), i18n("Delete"), StdGuiItem::del(), StdGuiItem::cancel())) { bool isLast=index==(combo->count()-1); combo->removeItem(index); @@ -300,7 +300,7 @@ QString ServerSettings::generateName(int ignore) const } for (int i=1; i<512; ++i) { - n=i18n("New Collection %1").arg(i); + n=i18n("New Collection %1", i); if (!collectionNames.contains(n)) { break; } diff --git a/gui/trayitem.cpp b/gui/trayitem.cpp index dbafe33de..82fef0408 100644 --- a/gui/trayitem.cpp +++ b/gui/trayitem.cpp @@ -162,15 +162,11 @@ void TrayItem::songChanged(const Song &song, bool isPlaying) QString album=song.album.isEmpty() ? song.name : song.album; QString text=song.artist.isEmpty() ? song.time<=0 - ? i18nc("Song on Album", "%1 on %2") - .arg(song.title).arg(album) - : i18nc("Song on Album (track duration)", "%1 on %2 (%3)") - .arg(song.title).arg(album).arg(Song::formattedTime(song.time)) + ? i18nc("Song on Album", "%1 on %2", song.title, album) + : i18nc("Song on Album (track duration)", "%1 on %2 (%3)", song.title, album, Song::formattedTime(song.time)) : song.time<=0 - ? i18nc("Song by Artist on Album", "%1 by %2 on %3") - .arg(song.title).arg(song.artist).arg(album) - : i18nc("Song by Artist on Album (track duration)", "%1 by %2 on %3 (%4)") - .arg(song.title).arg(song.artist).arg(album).arg(Song::formattedTime(song.time)); + ? i18nc("Song by Artist on Album", "%1 by %2 on %3", song.title, song.artist, album) + : i18nc("Song by Artist on Album (track duration)", "%1 by %2 on %3 (%4)", song.title, song.artist, album, Song::formattedTime(song.time)); if (trayItem) { #ifdef ENABLE_KDE_SUPPORT trayItem->setToolTip("cantata", i18n("Cantata"), text); diff --git a/http/httpserversettings.cpp b/http/httpserversettings.cpp index 405604595..dc24e5daf 100644 --- a/http/httpserversettings.cpp +++ b/http/httpserversettings.cpp @@ -37,13 +37,13 @@ static int isIfaceType(const QNetworkInterface &iface, const QString &prefix) static QString displayName(const QNetworkInterface &iface) { if (iface.name()=="lo") { - return i18n("Local loopback (%1)").arg(iface.name()); + return i18n("Local loopback (%1)", iface.name()); } if (isIfaceType(iface, "eth")) { - return i18n("Wired (%1)").arg(iface.name()); + return i18n("Wired (%1)", iface.name()); } if (isIfaceType(iface, "wlan")) { - return i18n("Wireless (%1)").arg(iface.name()); + return i18n("Wireless (%1)", iface.name()); } return iface.name(); } diff --git a/models/albumsmodel.cpp b/models/albumsmodel.cpp index 4447e92b6..c158457b4 100644 --- a/models/albumsmodel.cpp +++ b/models/albumsmodel.cpp @@ -263,7 +263,7 @@ QVariant AlbumsModel::data(const QModelIndex &index, int role) const case ItemView::Role_SubText: return Sort_AlbumArtist==sortAlbums ? al->artist : al->album; case ItemView::Role_TitleText: - return i18nc("Album by Artist", "%1 by %2").arg(al->album).arg(al->artist); + return i18nc("Album by Artist", "%1 by %2", al->album, al->artist); case Qt::SizeHintRole: if (!itemSize.isNull()) { return itemSize; diff --git a/models/digitallyimported.cpp b/models/digitallyimported.cpp index 2415b79db..dac4eec8c 100644 --- a/models/digitallyimported.cpp +++ b/models/digitallyimported.cpp @@ -216,7 +216,7 @@ void DigitallyImported::loginResponse() listenHash=lh; save(); } - status=i18n("Logged in (expiry:%1)").arg(expires.toString(Qt::ISODate)); + status=i18n("Logged in (expiry:%1)", expires.toString(Qt::ISODate)); controlTimer(); emit loginStatus(true, status); } diff --git a/models/musicmodel.cpp b/models/musicmodel.cpp index 206e592b8..4efabaa6d 100644 --- a/models/musicmodel.cpp +++ b/models/musicmodel.cpp @@ -200,7 +200,7 @@ QVariant MusicModel::data(const QModelIndex &index, int role) const if (MusicLibraryItem::Type_Artist==item->itemType()) { return item->data(); } else if (MusicLibraryItem::Type_Album==item->itemType()) { - return i18nc("Album by Artist", "%1 by %2").arg(item->data()).arg(item->parentItem()->data()); + return i18nc("Album by Artist", "%1 by %2", item->data(), item->parentItem()->data()); } break; case Qt::SizeHintRole: { diff --git a/models/onlineservicesmodel.cpp b/models/onlineservicesmodel.cpp index 83d0d6ae4..530c6590a 100644 --- a/models/onlineservicesmodel.cpp +++ b/models/onlineservicesmodel.cpp @@ -121,7 +121,7 @@ QVariant OnlineServicesModel::data(const QModelIndex &index, int role) const case Qt::ToolTipRole: if (MusicLibraryItem::Type_Root==item->itemType() && 0!=item->childCount() && static_cast(item)->isSearchBased() && !static_cast(item)->currentSearchString().isEmpty()) { - return MusicModel::data(index, role).toString()+"
    "+i18n("Last Search:%1").arg(static_cast(item)->currentSearchString()); + return MusicModel::data(index, role).toString()+"
    "+i18n("Last Search:%1", static_cast(item)->currentSearchString()); } break; case ItemView::Role_SubText: diff --git a/models/playqueuemodel.cpp b/models/playqueuemodel.cpp index e20e2dcdc..984b00d5f 100644 --- a/models/playqueuemodel.cpp +++ b/models/playqueuemodel.cpp @@ -360,7 +360,7 @@ QVariant PlayQueueModel::data(const QModelIndex &index, int role) const s.album+(s.year>0 ? (QLatin1String(" (")+QString::number(s.year)+QChar(')')) : QString())+QLatin1String("
    ")+ s.trackAndTitleStr(Song::isVariousArtists(s.albumArtist()))+QLatin1String("
    ")+ Song::formattedTime(s.time)+QLatin1String("
    ")+ - (s.priority>0 ? i18n("(Priority: %1)").arg(s.priority)+QLatin1String("
    ") : QString())+ + (s.priority>0 ? i18n("(Priority: %1)", s.priority)+QLatin1String("
    ") : QString())+ QLatin1String("")+s.file+QLatin1String(""); } } diff --git a/models/streamsmodel.cpp b/models/streamsmodel.cpp index 54c701425..74904f5e7 100644 --- a/models/streamsmodel.cpp +++ b/models/streamsmodel.cpp @@ -541,7 +541,7 @@ QVariant StreamsModel::data(const QModelIndex &index, int role) const } case Qt::DisplayRole: if (item==favourites && !favouritesIsWriteable) { - return i18n("%1 (Read-Only)").arg(item->name); + return i18n("%1 (Read-Only)", item->name); } return item->name; case Qt::ToolTipRole: @@ -1060,7 +1060,7 @@ void StreamsModel::persistFavourites() if (favourites->saveXml(fileName)) { Utils::setFilePerms(fileName); } else { - emit error(i18n("Failed to save stream list. Please check %1 is writable.").arg(fileName)); + emit error(i18n("Failed to save stream list. Please check %1 is writable.", fileName)); reloadFavourites(); } } diff --git a/mpd/mpdconnection.cpp b/mpd/mpdconnection.cpp index fcf59391c..b7566591c 100644 --- a/mpd/mpdconnection.cpp +++ b/mpd/mpdconnection.cpp @@ -148,9 +148,9 @@ QString MPDConnectionDetails::getName() const QString MPDConnectionDetails::description() const { if (hostname.startsWith('/')) { - return i18nc("name (host)", "\"%1\"").arg(getName()); + return i18nc("name (host)", "\"%1\"", getName()); } else { - return i18nc("name (host:port)", "\"%1\" (%2:%3)").arg(getName()).arg(hostname).arg(port); + return i18nc("name (host:port)", "\"%1\" (%2:%3)", getName(), hostname, port); } } @@ -353,18 +353,18 @@ void MPDConnection::reconnect() connect(reconnectTimer, SIGNAL(timeout()), this, SLOT(reconnect()), Qt::QueuedConnection); } if (abs(now-reconnectStart)>1) { - emit info(i18n("Connecting to %1").arg(details.description())); + emit info(i18n("Connecting to %1", details.description())); } reconnectTimer->start(500); } else { emit stateChanged(false); - emit error(i18n("Connection to %1 failed").arg(details.description()), true); + emit error(i18n("Connection to %1 failed", details.description()), true); reconnectStart=0; } break; case IncorrectPassword: emit stateChanged(false); - emit error(i18n("Connection to %1 failed - incorrect password").arg(details.description()), true); + emit error(i18n("Connection to %1 failed - incorrect password", details.description()), true); reconnectStart=0; break; } @@ -398,11 +398,11 @@ void MPDConnection::setDetails(const MPDConnectionDetails &d) break; case Failed: emit stateChanged(false); - emit error(i18n("Connection to %1 failed").arg(details.description()), true); + emit error(i18n("Connection to %1 failed", details.description()), true); break; case IncorrectPassword: emit stateChanged(false); - emit error(i18n("Connection to %1 failed - incorrect password").arg(details.description()), true); + emit error(i18n("Connection to %1 failed - incorrect password", details.description()), true); break; } } else if (diffName) { @@ -433,7 +433,7 @@ MPDConnection::Response MPDConnection::sendCommand(const QByteArray &command, bo DBUG << (void *)(&sock) << "sendCommand:" << command << emitErrors << retry; if (!isConnected()) { - emit error(i18n("Failed to send command to %1 - not connected").arg(details.description()), true); + emit error(i18n("Failed to send command to %1 - not connected", details.description()), true); return Response(false); } @@ -443,7 +443,7 @@ MPDConnection::Response MPDConnection::sendCommand(const QByteArray &command, bo // Failed to connect, so close *both* sockets! disconnectFromMPD(); emit stateChanged(false); - emit error(i18n("Connection to %1 failed").arg(details.description()), true); + emit error(i18n("Connection to %1 failed", details.description()), true); return Response(false); } } @@ -477,14 +477,14 @@ MPDConnection::Response MPDConnection::sendCommand(const QByteArray &command, bo } else { disconnectFromMPD(); emit stateChanged(false); - emit error(i18n("Failed to send command. Disconnected from %1").arg(details.description()), true); + emit error(i18n("Failed to send command. Disconnected from %1", details.description()), true); } } else if (!response.getError().isEmpty()) { emit error(response.getError()); } else { disconnectFromMPD(); emit stateChanged(false); - emit error(i18n("Failed to send command. Disconnected from %1").arg(details.description()), true); + emit error(i18n("Failed to send command. Disconnected from %1", details.description()), true); } } } @@ -981,7 +981,7 @@ void MPDConnection::onSocketStateChanged(QAbstractSocket::SocketState socketStat // Failed to connect idle socket - so close *both* disconnectFromMPD(); emit stateChanged(false); - emit error(i18n("Connection to %1 failed").arg(details.description()), true); + emit error(i18n("Connection to %1 failed", details.description()), true); } if (QAbstractSocket::ConnectedState==idleSocket.state()) { connect(&idleSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(onSocketStateChanged(QAbstractSocket::SocketState))); @@ -1008,7 +1008,7 @@ void MPDConnection::parseIdleReturn(const QByteArray &data) // Failed to connect idle socket - so close *both* disconnectFromMPD(); emit stateChanged(false); - emit error(i18n("Connection to %1 failed").arg(details.description()), true); + emit error(i18n("Connection to %1 failed", details.description()), true); } return; } @@ -1143,7 +1143,7 @@ void MPDConnection::renamePlaylist(const QString oldName, const QString newName) if (sendCommand("rename "+encodeName(oldName)+' '+encodeName(newName), false).ok) { emit playlistRenamed(oldName, newName); } else { - emit error(i18n("Failed to rename %1 to %2").arg(oldName).arg(newName)); + emit error(i18n("Failed to rename %1 to %2", oldName, newName)); } } @@ -1155,7 +1155,7 @@ void MPDConnection::removePlaylist(const QString &name) void MPDConnection::savePlaylist(const QString &name) { if (!sendCommand("save "+encodeName(name), false).ok) { - emit error(i18n("Failed to save %1").arg(name)); + emit error(i18n("Failed to save %1", name)); } } diff --git a/mpd/song.cpp b/mpd/song.cpp index 541a156d3..d2502ba91 100644 --- a/mpd/song.cpp +++ b/mpd/song.cpp @@ -302,7 +302,7 @@ QString Song::entryName() const return file; } - return i18nc("Song\nArtist\nAlbum", "%1\n%2\n%3").arg(title).arg(artist).arg(album); + return i18nc("Song\nArtist\nAlbum", "%1\n%2\n%3", title, artist, album); } QString Song::artistSong() const diff --git a/online/onlineservice.cpp b/online/onlineservice.cpp index 104bc8886..de970adf3 100644 --- a/online/onlineservice.cpp +++ b/online/onlineservice.cpp @@ -346,7 +346,7 @@ void OnlineService::loaderstatus(const QString &msg, int prog) if (prog<0) { setStatusMessage(msg); } else { - setStatusMessage(i18nc("Message percent", "%1 %2%").arg(msg).arg(prog)); + setStatusMessage(i18nc("Message percent", "%1 %2%", msg, prog)); } } diff --git a/online/onlineservicespage.cpp b/online/onlineservicespage.cpp index 65b8c5610..886f455a3 100644 --- a/online/onlineservicespage.cpp +++ b/online/onlineservicespage.cpp @@ -279,7 +279,7 @@ void OnlineServicesPage::controlSearch(bool on) genreCombo->setCurrentIndex(0); genreCombo->setEnabled(false); } - view->setSearchLabelText(i18nc("Search ServiceName:", "Search %1:").arg(searchService)); + view->setSearchLabelText(i18nc("Search ServiceName:", "Search %1:", searchService)); view->setBackgroundImage(srv->icon()); } QModelIndex filterIndex=srv ? OnlineServicesModel::self()->index(srv) : QModelIndex(); @@ -393,7 +393,7 @@ void OnlineServicesPage::refreshService() OnlineService *srv=static_cast(item); if (srv->isLoaded() && srv->childCount()>0 && - MessageBox::No==MessageBox::questionYesNo(this, i18n("Re-download music listing for %1?").arg(srv->id()), i18n("Re-download"), + MessageBox::No==MessageBox::questionYesNo(this, i18n("Re-download music listing for %1?", srv->id()), i18n("Re-download"), GuiItem(i18n("Re-download")), StdGuiItem::cancel())) { return; } diff --git a/replaygain/rgdialog.cpp b/replaygain/rgdialog.cpp index aeda20166..97e891925 100644 --- a/replaygain/rgdialog.cpp +++ b/replaygain/rgdialog.cpp @@ -526,7 +526,7 @@ void RgDialog::scannerDone() if (s->success()) { track.progress=100; track.data=s->results(); - item->setText(COL_TRACKGAIN, i18n("%1 dB").arg(formatNumber(Scanner::reference(track.data.loudness), 2))); + item->setText(COL_TRACKGAIN, i18n("%1 dB", formatNumber(Scanner::reference(track.data.loudness), 2))); item->setText(COL_TRACKPEAK, formatNumber(track.data.peakValue(), 6)); QFont f(font()); f.setItalic(true); @@ -581,7 +581,7 @@ void RgDialog::scannerDone() (*a).data=Scanner::global(as); foreach (int idx, (*a).tracks) { QTreeWidgetItem *item=view->topLevelItem(idx); - item->setText(COL_ALBUMGAIN, i18n("%1 dB").arg(formatNumber(Scanner::reference((*a).data.loudness), 2))); + item->setText(COL_ALBUMGAIN, i18n("%1 dB", formatNumber(Scanner::reference((*a).data.loudness), 2))); item->setText(COL_ALBUMPEAK, formatNumber((*a).data.peak, 6)); if (origTags.contains(idx)) { @@ -640,9 +640,9 @@ void RgDialog::songTags(int index, Tags::ReplayGain tags) if (!item) { return; } - item->setText(COL_TRACKGAIN, i18n("%1 dB").arg(formatNumber(tags.trackGain, 2))); + item->setText(COL_TRACKGAIN, i18n("%1 dB", formatNumber(tags.trackGain, 2))); item->setText(COL_TRACKPEAK, formatNumber(tags.trackPeak, 6)); - item->setText(COL_ALBUMGAIN, i18n("%1 dB").arg(formatNumber(tags.albumGain, 2))); + item->setText(COL_ALBUMGAIN, i18n("%1 dB", formatNumber(tags.albumGain, 2))); item->setText(COL_ALBUMPEAK, formatNumber(tags.albumPeak, 6)); } } diff --git a/streams/streamfetcher.cpp b/streams/streamfetcher.cpp index fdebd8e94..3b7e01d8f 100644 --- a/streams/streamfetcher.cpp +++ b/streams/streamfetcher.cpp @@ -195,7 +195,7 @@ void StreamFetcher::doNext() current=todo.takeFirst(); QUrl u(current); currentName=MPDParseUtils::getStreamName(current); - emit status(i18n("Fetching %1").arg(currentName.isEmpty() ? u.toString() : currentName)); + emit status(i18n("Fetching %1", currentName.isEmpty() ? u.toString() : currentName)); if (!currentName.isEmpty()) { current=current.left(current.length()-(currentName.length()+1)); } diff --git a/streams/streamspage.cpp b/streams/streamspage.cpp index 1fa4337eb..4218af4e4 100644 --- a/streams/streamspage.cpp +++ b/streams/streamspage.cpp @@ -247,7 +247,7 @@ void StreamsPage::importXml() } if (!StreamsModel::self()->importIntoFavourites(fileName)) { - MessageBox::error(this, i18n("Failed to import %1!
    Please check this is of the correct type.").arg(fileName)); + MessageBox::error(this, i18n("Failed to import %1!
    Please check this is of the correct type.", fileName)); } } @@ -273,7 +273,7 @@ void StreamsPage::exportXml() } if (!StreamsModel::self()->exportFavourites(fileName)) { - MessageBox::error(this, i18n("Failed to create %1!").arg(fileName)); + MessageBox::error(this, i18n("Failed to create %1!", fileName)); } } @@ -290,9 +290,9 @@ void StreamsPage::add() QString existingNameForUrl=StreamsModel::self()->favouritesNameForUrl(url); if (!existingNameForUrl.isEmpty()) { - MessageBox::error(this, i18n("Stream already exists!
    %1").arg(existingNameForUrl)); + MessageBox::error(this, i18n("Stream already exists!
    %1", existingNameForUrl)); } else if (StreamsModel::self()->nameExistsInFavourites(name)) { - MessageBox::error(this, i18n("A stream named %1 already exists!").arg(name)); + MessageBox::error(this, i18n("A stream named %1 already exists!", name)); } else { StreamsModel::self()->addToFavourites(url, name); } @@ -387,7 +387,7 @@ void StreamsPage::reload() return; } - if (cat->children.isEmpty() || cat->cacheName.isEmpty() || MessageBox::Yes==MessageBox::questionYesNo(this, i18n("Reload %1 streams?").arg(cat->name))) { + if (cat->children.isEmpty() || cat->cacheName.isEmpty() || MessageBox::Yes==MessageBox::questionYesNo(this, i18n("Reload %1 streams?", cat->name))) { StreamsModel::self()->reload(mapped); } } @@ -405,13 +405,13 @@ void StreamsPage::removeItems() const StreamsModel::Item *item=static_cast(mapped.internalPointer()); if (item->isCategory() && item->parent) { if (item->parent->isBookmarks) { - if (MessageBox::No==MessageBox::warningYesNo(this, i18n("Are you sure you wish to remove bookmark to %1?").arg(item->name))) { + if (MessageBox::No==MessageBox::warningYesNo(this, i18n("Are you sure you wish to remove bookmark to %1?", item->name))) { return; } StreamsModel::self()->removeBookmark(mapped); return; } else if (static_cast(item)->isBookmarks) { - if (MessageBox::No==MessageBox::warningYesNo(this, i18n("Are you sure you wish to remove all %1 bookmarks?").arg(item->parent->name))) { + if (MessageBox::No==MessageBox::warningYesNo(this, i18n("Are you sure you wish to remove all %1 bookmarks?", item->parent->name))) { return; } StreamsModel::self()->removeAllBookmarks(mapped); @@ -439,12 +439,12 @@ void StreamsPage::removeItems() } if (useable.size()>1) { - if (MessageBox::No==MessageBox::warningYesNo(this, i18n("Are you sure you wish to remove the %1 selected streams?").arg(useable.size()))) { + if (MessageBox::No==MessageBox::warningYesNo(this, i18n("Are you sure you wish to remove the %1 selected streams?", useable.size()))) { return; } } else { - if (MessageBox::No==MessageBox::warningYesNo(this, i18n("Are you sure you wish to remove %1?") - .arg(StreamsModel::self()->data(useable.first(), Qt::DisplayRole).toString()))) { + if (MessageBox::No==MessageBox::warningYesNo(this, i18n("Are you sure you wish to remove %1?", + StreamsModel::self()->data(useable.first(), Qt::DisplayRole).toString()))) { return; } } @@ -486,9 +486,9 @@ void StreamsPage::edit() QString existingNameForUrl=newUrl!=url ? StreamsModel::self()->favouritesNameForUrl(newUrl) : QString(); if (!existingNameForUrl.isEmpty()) { - MessageBox::error(this, i18n("Stream already exists!
    %1").arg(existingNameForUrl)); + MessageBox::error(this, i18n("Stream already exists!
    %1", existingNameForUrl)); } else if (newName!=name && StreamsModel::self()->nameExistsInFavourites(newName)) { - MessageBox::error(this, i18n("A stream named %1 already exists!").arg(newName)); + MessageBox::error(this, i18n("A stream named %1 already exists!", newName)); } else { item->name=newName; item->url=newUrl; diff --git a/support/localize.h b/support/localize.h index 4d211db07..5091dc71a 100644 --- a/support/localize.h +++ b/support/localize.h @@ -29,8 +29,125 @@ #else #include #include "qtplural.h" -#define i18n QObject::tr -#define i18nc(A, B) QObject::tr(B, A) + +inline QString i18n(const char *text) +{ + return QObject::tr(text); +} + +template +inline QString i18n(const char *text, const A1 &a1) +{ + return QObject::tr(text).arg(a1); +} + +template +inline QString i18n(const char *text, const A1 &a1, const A2 &a2) +{ + return QObject::tr(text).arg(a1).arg(a2); +} + +template +inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3) +{ + return QObject::tr(text).arg(a1).arg(a2).arg(a3); +} + +template +inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) +{ + return QObject::tr(text).arg(a1).arg(a2).arg(a3).arg(a4); +} + +template +inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) +{ + return QObject::tr(text).arg(a1).arg(a2).arg(a3).arg(a4).arg(a5); +} + +template +inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) +{ + return QObject::tr(text).arg(a1).arg(a2).arg(a3).arg(a4).arg(a5).arg(a6); +} + +template +inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) +{ + return QObject::tr(text).arg(a1).arg(a2).arg(a3).arg(a4).arg(a5).arg(a6).arg(a7); +} + +template +inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) +{ + return QObject::tr(text).arg(a1).arg(a2).arg(a3).arg(a4).arg(a5).arg(a6).arg(a7).arg(a8); +} + +template +inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9) +{ + return QObject::tr(text).arg(a1).arg(a2).arg(a3).arg(a4).arg(a5).arg(a6).arg(a7).arg(a8).arg(a9); +} + +inline QString i18nc(const char *ctxt, const char *text) +{ + return QObject::tr(text, ctxt); +} + +template +inline QString i18nc(const char *ctxt, const char *text, const A1 &a1) +{ + return QObject::tr(text, ctxt).arg(a1); +} + +template +inline QString i18nc(const char *ctxt, const char *text, const A1 &a1, const A2 &a2) +{ + return QObject::tr(text, ctxt).arg(a1).arg(a2); +} + +template +inline QString i18nc(const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3) +{ + return QObject::tr(text, ctxt).arg(a1).arg(a2).arg(a3); +} + +template +inline QString i18nc(const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) +{ + return QObject::tr(text, ctxt).arg(a1).arg(a2).arg(a3).arg(a4); +} + +template +inline QString i18nc(const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) +{ + return QObject::tr(text, ctxt).arg(a1).arg(a2).arg(a3).arg(a4).arg(a5); +} + +template +inline QString i18nc(const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) +{ + return QObject::tr(text, ctxt).arg(a1).arg(a2).arg(a3).arg(a4).arg(a5).arg(a6); +} + +template +inline QString i18nc(const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) +{ + return QObject::tr(text, ctxt).arg(a1).arg(a2).arg(a3).arg(a4).arg(a5).arg(a6).arg(a7); +} + +template +inline QString i18nc(const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) +{ + return QObject::tr(text, ctxt).arg(a1).arg(a2).arg(a3).arg(a4).arg(a5).arg(a6).arg(a7).arg(a8); +} + +template +inline QString i18nc(const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9) +{ + return QObject::tr(text, ctxt).arg(a1).arg(a2).arg(a3).arg(a4).arg(a5).arg(a6).arg(a7).arg(a8).arg(a9); +} + #endif #endif diff --git a/support/utils.cpp b/support/utils.cpp index 01d1613d5..d994d8594 100644 --- a/support/utils.cpp +++ b/support/utils.cpp @@ -268,19 +268,19 @@ QString Utils::formatByteSize(double size) if (useSiUnites) { switch(unit) { - case 0: return i18n("%1 B").arg(size); - case 1: return i18n("%1 kB").arg(locale.toString(size, 'f', 1)); - case 2: return i18n("%1 MB").arg(locale.toString(size, 'f', 1)); + case 0: return i18n("%1 B", size); + case 1: return i18n("%1 kB", locale.toString(size, 'f', 1)); + case 2: return i18n("%1 MB", locale.toString(size, 'f', 1)); default: - case 3: return i18n("%1 GB").arg(locale.toString(size, 'f', 1)); + case 3: return i18n("%1 GB", locale.toString(size, 'f', 1)); } } else { switch(unit) { - case 0: return i18n("%1 B").arg(size); - case 1: return i18n("%1 KiB").arg(locale.toString(size, 'f', 1)); - case 2: return i18n("%1 MiB").arg(locale.toString(size, 'f', 1)); + case 0: return i18n("%1 B", size); + case 1: return i18n("%1 KiB", locale.toString(size, 'f', 1)); + case 2: return i18n("%1 MiB", locale.toString(size, 'f', 1)); default: - case 3: return i18n("%1 GiB").arg(locale.toString(size, 'f', 1)); + case 3: return i18n("%1 GiB", locale.toString(size, 'f', 1)); } } } diff --git a/tags/tageditor.cpp b/tags/tageditor.cpp index 71c48163c..adfefd983 100644 --- a/tags/tageditor.cpp +++ b/tags/tageditor.cpp @@ -542,7 +542,7 @@ void TagEditor::updateTrackName(int index, bool edited) if (isAll) { trackName->setItemText(index, i18n("All tracks [modified]")); } else { - trackName->setItemText(index, i18n("%1 [modified]").arg(original.at(index).file)); + trackName->setItemText(index, i18n("%1 [modified]", original.at(index).file)); } } else { if (isAll) { diff --git a/tags/trackorganiser.cpp b/tags/trackorganiser.cpp index 88b481dab..11c299c97 100644 --- a/tags/trackorganiser.cpp +++ b/tags/trackorganiser.cpp @@ -254,7 +254,7 @@ void TrackOrganiser::renameFile() if (autoSkip) { skip=true; } else { - switch(MessageBox::questionYesNoCancel(this, i18n("Destination file already exists!
    %1").arg(dest), + switch(MessageBox::questionYesNoCancel(this, i18n("Destination file already exists!
    %1", dest), QString(), GuiItem(i18n("Skip")), GuiItem(i18n("Auto Skip")))) { case MessageBox::Yes: skip=true; @@ -276,7 +276,7 @@ void TrackOrganiser::renameFile() if (autoSkip) { skip=true; } else { - switch(MessageBox::questionYesNoCancel(this, i18n("Failed to create destination folder!
    %1").arg(dir.absolutePath()), + switch(MessageBox::questionYesNoCancel(this, i18n("Failed to create destination folder!
    %1", dir.absolutePath()), QString(), GuiItem(i18n("Skip")), GuiItem(i18n("Auto Skip")))) { case MessageBox::Yes: skip=true; @@ -297,7 +297,7 @@ void TrackOrganiser::renameFile() if (autoSkip) { skip=true; } else { - switch(MessageBox::questionYesNoCancel(this, i18n("Failed to rename %1 to %2").arg(source).arg(dest), + switch(MessageBox::questionYesNoCancel(this, i18n("Failed to rename %1 to %2", source, dest), QString(), GuiItem(i18n("Skip")), GuiItem(i18n("Auto Skip")))) { case MessageBox::Yes: skip=true; diff --git a/widgets/coverwidget.cpp b/widgets/coverwidget.cpp index c37cca58b..d81043c42 100644 --- a/widgets/coverwidget.cpp +++ b/widgets/coverwidget.cpp @@ -257,7 +257,7 @@ bool CoverWidget::eventFilter(QObject *object, QEvent *event) toolTip+=i18n("Artist:%1" "Album:%2" - "Year:%3").arg(current.artist).arg(current.album).arg(current.year); + "Year:%3", current.artist, current.album, current.year); toolTip+=""; if (!img.isNull()) { if (img.size().width()>Covers::constMaxSize.width() || img.size().height()>Covers::constMaxSize.height() || diff --git a/widgets/groupedview.cpp b/widgets/groupedview.cpp index ece96352c..02040f4fc 100644 --- a/widgets/groupedview.cpp +++ b/widgets/groupedview.cpp @@ -262,9 +262,9 @@ public: quint16 year=Song::albumYear(song); if (year>0) { - title=i18nc("artist - album (albumYear)", "%1 - %2 (%3)").arg(song.albumArtist()).arg(album).arg(year); + title=i18nc("artist - album (albumYear)", "%1 - %2 (%3)", song.albumArtist(), album, year); } else { - title=i18nc("artist - album", "%1 - %2").arg(song.albumArtist()).arg(album); + title=i18nc("artist - album", "%1 - %2", song.albumArtist(), album); } track=formatNumber(song.track)+QChar(' ')+trackTitle; }